diff --git a/core/services/WebServiceApiService.py b/core/services/WebServiceApiService.py index 5579b97..c810fb2 100644 --- a/core/services/WebServiceApiService.py +++ b/core/services/WebServiceApiService.py @@ -180,6 +180,7 @@ class WebServiceApiService: data['operator'].get('domain'), data['operator'].get('hysteria2_host'), data['operator'].get('vless_host'), + data.get('server_ip'), ) return None diff --git a/core/services/encrypted_proxy/hysteria_service.py b/core/services/encrypted_proxy/hysteria_service.py index f93a513..44e30a0 100644 --- a/core/services/encrypted_proxy/hysteria_service.py +++ b/core/services/encrypted_proxy/hysteria_service.py @@ -93,20 +93,17 @@ def enable_hysteria(username: str, password: str, server_host: str, _connected = False try: - # Fase 1 — arrancar sing-box runner.write_config(config_path, config) if not runner.start(config_path): if observer: observer.notify("error", "sing-box not active after start") return False - # Fase 2 — esperar a que tun aparezca if not wait_for_tun(timeout=15.0): if observer: observer.notify("error", f"{Constants.SINGBOX_TUN_IF} did not appear after 15s") return False - # Fase 3 — armar kill switch ahora que la interfaz existe if not killswitch.arm(server_ip, Constants.SINGBOX_TUN_IF): if observer: observer.notify("error", "Failed to arm kill switch") @@ -121,6 +118,7 @@ def enable_hysteria(username: str, password: str, server_host: str, observer.notify("connected", { "tunnel_if": Constants.SINGBOX_TUN_IF, "socks5_port": socks5_port, + "server_ip": server_ip, "dns_enabled": _C.HYSTERIA2_DNS_ENABLED, "dns_active": dns_ok, }) diff --git a/core/services/encrypted_proxy/vless_service.py b/core/services/encrypted_proxy/vless_service.py index 0cdfa96..3980db0 100644 --- a/core/services/encrypted_proxy/vless_service.py +++ b/core/services/encrypted_proxy/vless_service.py @@ -147,6 +147,7 @@ def enable_vless(vless_link: str, username: str, server_ip: str, observer.notify("connected", { "tunnel_if": Constants.SINGBOX_TUN_IF, "socks5_port": socks5_port, + "server_ip": server_ip, "dns_enabled": _C.VLESS_DNS_ENABLED, "dns_active": dns_ok, })