20 lines
No EOL
769 B
Text
20 lines
No EOL
769 B
Text
from core.observers.ConnectionObserver import ConnectionObserver
|
|
from core.services.networking.systemwide.encrypted_proxy.get_proxy_data import post_operator_proxy
|
|
|
|
import json
|
|
observer = ConnectionObserver()
|
|
observer.subscribe("connecting", lambda msg: print(f"[CONNECT] {msg}"))
|
|
observer.subscribe("tor_bootstrapping", lambda msg: print(f"[BOOTSTRAP] {msg}"))
|
|
observer.subscribe("tor_bootstrap_progressing", lambda msg: print(f"[PROGRESS] {msg}"))
|
|
observer.subscribe("tor_bootstrapped", lambda msg: print(f"[SUCCESS] {msg}"))
|
|
observer.subscribe("custom_message", lambda msg: print(f"[INFO] {msg}"))
|
|
|
|
|
|
results = post_operator_proxy(
|
|
billing_code="2UEN-SXAJ-Z1YO-93EJ",
|
|
location_id=4,
|
|
protocol="hysteria2",
|
|
connection_observer=observer
|
|
)
|
|
|
|
print(results) |