small fix
This commit is contained in:
parent
d6b122b975
commit
7dca2744ce
3 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue