diff --git a/README.md b/README.md index 4d62fd3..4a93c3b 100644 --- a/README.md +++ b/README.md @@ -173,17 +173,24 @@ sudo systemctl enable --now owrt-remote-xray ```sh sudo ufw allow 8088/tcp +sudo ufw allow 80/tcp sudo ufw allow 8443/tcp ``` +После свежей установки Hub слушает и `8088`, и стандартный `80`. С телефона можно открыть так: + +```text +http://YOUR_VPS_IP/ +``` + Если с мобильного интернета панель не открывается, проверь на VPS: ```sh sudo systemctl restart owrt-remote -sudo ss -lntp | grep ':8088' +sudo ss -lntp | grep -E ':(80|8088)' ``` -Правильно, когда видно `0.0.0.0:8088` или `*:8088`. Если видно только `127.0.0.1:8088`, Hub доступен только внутри VPS. Если порт слушает правильно, но с телефона не открывается `http://YOUR_VPS_IP:8088/`, открой `8088/tcp` еще и в firewall личного кабинета VPS-провайдера. +Правильно, когда видно `0.0.0.0:80` и `0.0.0.0:8088` или `*:80` и `*:8088`. Если видно только `127.0.0.1`, Hub доступен только внутри VPS. Если порт слушает правильно, но с телефона не открывается `http://YOUR_VPS_IP/`, открой `80/tcp`, `8088/tcp` и `8443/tcp` еще и в firewall личного кабинета VPS-провайдера. Если по домашнему интернету работает, а через мобильного оператора нет, чаще всего оператор режет нестандартный порт `8088` или WebSocket. Надежный вариант для телефона: повесить Hub на домен через HTTPS/443, а внутри проксировать на `127.0.0.1:8088`. diff --git a/vps/owrt-remote-hub.py b/vps/owrt-remote-hub.py index f299459..f214c74 100644 --- a/vps/owrt-remote-hub.py +++ b/vps/owrt-remote-hub.py @@ -1363,7 +1363,11 @@ async function pollHttpTerminal() {{ async function startHttpTerminal(reason) {{ if (terminalMode === 'http' || httpSid) return; terminalMode = 'http'; - write(`\\r\\n[${{reason}}]\\r\\nWebSocket не открылся, включаю запасной HTTP-terminal...\\r\\n`); + if (reason === 'mobile') {{ + write('\\r\\nHTTP-terminal подключается...\\r\\n'); + }} else {{ + write(`\\r\\n[${{reason}}]\\r\\nWebSocket не открылся, включаю запасной HTTP-terminal...\\r\\n`); + }} try {{ const res = await fetch('{session_path}', {{cache: 'no-store'}}); const data = await res.json(); @@ -1394,6 +1398,11 @@ async function explainTerminalError(source) {{ }} }} function connect() {{ + const mobileTerminal = window.matchMedia('(max-width: 680px)').matches || /Android|iPhone|iPad|iPod|Mobile|Telegram/i.test(navigator.userAgent); + if (mobileTerminal) {{ + startHttpTerminal('mobile'); + return; + }} const proto = location.protocol === 'https:' ? 'wss://' : 'ws://'; ws = new WebSocket(proto + location.host + '{ws_path}'); ws.onopen = () => {{ wsOpened = true; }}; @@ -1491,17 +1500,14 @@ input:focus{{border-color:rgba(34,211,238,.62);box-shadow:0 0 0 3px rgba(34,211, button{{width:100%;margin-top:13px;border:1px solid rgba(255,255,255,.12);border-radius:8px;padding:11px 12px;background:linear-gradient(135deg,#7c3aed,#a855f7);color:#fff;font-weight:950;cursor:pointer;box-shadow:0 14px 30px rgba(124,58,237,.28)}} button:hover{{filter:brightness(1.06)}} .err{{margin:0 0 12px;padding:11px 12px;border:1px solid rgba(251,113,133,.45);border-radius:8px;background:rgba(251,113,133,.14);color:#fecdd3;font-weight:800}} -@media(max-width:520px){{body{{padding:14px}}.login{{padding:15px}}.brand{{grid-template-columns:68px minmax(0,1fr)}}h1{{font-size:22px}}.logo{{width:68px;height:32px}}.brand .appBanner{{height:32px}}}} +.login .brand{{display:block;text-align:center;margin-bottom:14px}}.login .brand .appBanner{{width:100%;height:40px;font-size:15px}}.logo{{display:none}} +@media(max-width:520px){{body{{padding:14px}}.login{{padding:15px}}h1{{font-size:22px}}.login .brand .appBanner{{height:38px}}}}