diff --git a/app.py b/app.py index aafb57c..0d2baae 100644 --- a/app.py +++ b/app.py @@ -193,9 +193,12 @@ async def run_browser_task(task_id: str, task: str, max_steps: int, model: str): # Проверка порта import socket - with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: - if s.connect_ex(('127.0.0.1', REMOTE_DEBUGGING_PORT)) == 0: - print(f"[{task_id}] Port {REMOTE_DEBUGGING_PORT} is OPEN internally!") + for host in ['127.0.0.1', '0.0.0.0', ip_address]: + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + if s.connect_ex((host, REMOTE_DEBUGGING_PORT)) == 0: + print(f"[{task_id}] Port {REMOTE_DEBUGGING_PORT} is OPEN on {host}!") + else: + print(f"[{task_id}] Port {REMOTE_DEBUGGING_PORT} is CLOSED on {host}!") try: response = urllib.request.urlopen(f"{cdp_url}/json/version", timeout=2)