瀏覽器中繼 · SSH 隧道 · 閘道連接埠 · 六步驟驗收操作手冊
2026年預設情況下,閘道常聽127.0.0.1:18789儘管瀏覽器中繼在開發筆記型電腦上收聽127.0.0.1:18792。將網關移至遠端 VPS 會將控制平面和瀏覽器分成不同的網路命名空間:代理程式仍然顯示“localhost”,但瀏覽器位於您的筆記型電腦上。社群報告(遠端網關加 SSH 隧道)圍繞著三個問題:僅檢查本地運行時映射(通過隧道的 401)的中繼身份驗證、錯誤連接埠上的 EADDRINUSE 探測以及沒有附加選項卡的擴展 ON。將「通道回覆」視為完全接受會浪費數小時調整模型逾時。
擴展綠色等於端對端通過:ON 僅表示中繼程序監聽;如果不在目標站點上開啟並附加選項卡,CDP 仍將報告沒有選項卡。
隧道方向反轉:當遠端網關必須到達本地18792時,使用遠端轉發-R;將遠端 18789 對應到您的筆記型電腦-L單獨並不能修復瀏覽器平面。
令牌和連接埠表漂移:中繼令牌、隧道映射和擴充選項必須是一組;更改一個而不更改其他連接埠會產生 401 或空連接埠。
與無頭 Docker 混合:容器需要shm_大小;本地中繼需要隧道和連線 - 請參閱無頭清單。
為了方便起見,將網關綁定到 0.0.0.0:擴大控制平面的暴露範圍;保持環回加隧道或專用網絡網路文章。
將這五項編碼為您的零錢票中的隧道必備品和禁止模式。下一節給出了複製貼上驗收步驟之前無頭容器和本地中繼之間的簽核矩陣。
選擇依據瀏覽器在哪裡運作、誰持有使用者會話以及合規性邊界——不是個人喜好。在表格後選擇一本操作手冊;不要在一個變更視窗中調整兩個堆疊。
| Pattern | When it fits | Main cost and risk |
|---|---|---|
| Docker 無頭 Chrom | Unattended VPS batches without laptop SSO | High shm/memory peaks; fingerprint may differ from a real profile |
| 本地 Chrome + 中繼 | Needs laptop cookies/SSO, human-in-the-loop debugging | SSH tunnels and extension attach; remote Gateway must not expose browser to the public internet |
| 專用 24/7 雲端 Mac + 中繼 | Team shared capacity in one region | Higher ops cost but defensible SLA and tunnel templates |
繼電器穩定性主要是誰擁有連接埠 18792、隧道映射的本地主機以及令牌是否是一組;其他調整都是次要的。
官方2026年指導仍建議openclaw 板載 --install-daemon加開爪網關狀態和開爪醫生對於控制平面。瀏覽器技能將中繼運作狀況和標籤附加新增為等於網關綠色的釋放閘門。
這個序列繼續網關安裝故障排除清單:證明控制平面,然後是瀏覽器平面。將每個步驟的輸出貼到票證中。
接受網關:在VPS上運行開爪網關狀態;確認 18789(或您記錄的連接埠)上的環回綁定;只能透過代理或 SSH 存取。
啟動本地中繼:安裝 Chrome 擴充功能;跑步捲曲-sS http://127.0.0.1:18792/health在筆記型電腦上。
附加一個選項卡:打開目標網站並通過擴展附加;無需附加,沒有連線選項卡預計。
建立隧道:從筆記型電腦,例如ssh -N -R 18793:127.0.0.1:18792 用戶@vps並將網關中繼 URL 指向127.0.0.1:18793在 VPS 上。
對齊標記:將網關中繼/網關令牌與擴充或 env 注入相匹配;在通過隧道的 401 上,驗證網關令牌標頭而不是僅限本地的運行時映射。
端對端技能:尾隨時運行最低限度的瀏覽器技能openclaw 日誌 --follow;如果發生故障,請使用症狀表,一次一個旋鈕。
curl -sS http://127.0.0.1:18792/health openclaw gateway status ssh -N -R 18793:127.0.0.1:18792 user@your-vps.example curl -sS http://127.0.0.1:18793/health
提示:如果您切換到容器內無頭瀏覽器,請使用無頭技能清單而不是在此 Runbook 上堆疊 shm 調整。
首先按症狀索引。每個實驗更改一個變數並存檔curl 和日誌片段。
| Symptom | Check first | Typical cause and move |
|---|---|---|
| 擴充打開,技能顯示未連接選項卡 | Tab opened and attached on target URL | Operational gate; document in runbook |
| 隧道後curl 映射端口/健康失敗 | ssh -R alive, remote listener | Tunnel died or port taken; use ss -lntp |
| 中繼 401/未經授權 | Token headers and configs | Remote tunnel not using gateway token; align configs |
| EADDRINUSE 但瀏覽器仍不可用 | Probe port vs real Relay port | Unify port table; see community tunnel cases |
| 網關 CLI 逾時 | 18789 reachability, SSH -L | Read networking article before blaming Relay |
警告:不要在一次更改中輪換 API 金鑰、反向代理證書和隧道連接埠;三重移動不可平分。
Local Relay適合互動式除錯和筆記型電腦身分;當您需要 24/7 無人操作或無法維護個人筆記型電腦隧道時,請移動拓撲。
| Signal | Suggested action | Notes |
|---|---|---|
| 許多用戶依賴一台開發人員筆記型電腦隧道 | Move to headless Docker or dedicated cloud Mac | Removes bus factor |
| 睡眠時隧道每週下降 | Use regional 24/7 node plus standardized ssh/systemd | Track tunnel uptime in SLO |
| 公共互聯網瀏覽器的要求 | Do not; use headless or compliant remote desktop | Relay assumes loopback trust |
Ad-hoc VPS plus manual SSH is flexible early, but production OpenClaw needs sign-off capacity and ticketed changes personal tunnels rarely provide. Placing Gateway and browser workloads on a predictable 24/7 cloud Mac footprint with fixed runbooks beats endless port edits. For teams needing dedicated, region-stable Mac capacity, VpsMesh Mac Mini cloud rental is usually the better fit—easier to co-locate control plane with Relay or headless profiles. See pricing and help center.
Use -L to pull remote Gateway control plane to your laptop for debugging. Use -R so the VPS can reach local 18792, matching the Gateway relay URL. More on control-plane timeouts in the Compose networking article.
Open and attach a tab on the target site first. If attach still fails, check tunnel health and tokens using the install troubleshooting checklist log sequence.
Not recommended. Keep loopback plus SSH/private network, or switch to headless Docker skills or a dedicated node.