Skip to content

fix(browser): connect remote --host 0.0.0.0 bridge clients - #100

Open
zzalancelot wants to merge 2 commits into
omdsh-dev:mainfrom
zzalancelot:fix/remote-host-bridge
Open

zzalancelot wants to merge 2 commits into
omdsh-dev:mainfrom
zzalancelot:fix/remote-host-bridge

Conversation

@zzalancelot

Copy link
Copy Markdown
Contributor

Fixes #97

Remote clients could not reach a --host 0.0.0.0 bridge even when the panel address and token were correct.

  • /ext/bridge-config always returned ws://127.0.0.1, so discovery handed a LAN client a URL that only works on the host.
  • Extension connect-src only allowed loopback, so Chromium blocked the WebSocket before the panel settings were used.

/ext/bridge-config now builds wsUrl from the request Host (and X-Forwarded-Host / X-Forwarded-Proto when present). connect-src allows any ws / wss / http / https host, so the panel can be set to ws://<host>:<port>/ext/bridge without rebuilding for each LAN address. Non-loopback clients still need the host bridge token.

Derive /ext/bridge-config wsUrl from the request Host and allow
EXT_CONNECT_SRC to append LAN origins to the extension connect-src CSP
at build time so remote deployments match the documented flow.
Scheme-wide connect-src already allows any ws/http(s) host, so a remote
client can paste ws://<host>:<port>/ext/bridge instead of rebuilding the
extension for each LAN address.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

远程 --host 0.0.0.0 部署无法连接:connect-src 是固定 origin 列表,且 /ext/bridge-config 硬编码回环地址

1 participant