Skip to content

fix(server): proxy websocket sandbox routes#388

Open
liuxiaopai-ai wants to merge 1 commit intoalibaba:mainfrom
liuxiaopai-ai:codex/issue-383-server-ws-proxy
Open

fix(server): proxy websocket sandbox routes#388
liuxiaopai-ai wants to merge 1 commit intoalibaba:mainfrom
liuxiaopai-ai:codex/issue-383-server-ws-proxy

Conversation

@liuxiaopai-ai
Copy link
Contributor

Summary

  • add server-side websocket proxy routes for /sandboxes/{id}/proxy/{port} and nested paths
  • support proxying the root path returned by use_server_proxy=true
  • forward endpoint routing headers through both HTTP and websocket proxy paths

Root cause

Issue #383 is real. The server proxy only registered HTTP routes and explicitly treated websocket upgrades as unsupported, so browser websocket handshakes never reached the sandbox backend. Separately, get_endpoint(..., use_server_proxy=true) returned /proxy/{port} but the server only handled /proxy/{port}/{full_path}.

Testing

  • cd server && uv run pytest tests/test_routes_proxy.py
  • cd server && uv run pytest tests/test_routes*.py
  • cd server && uv run pyright src/api/lifecycle.py tests/test_routes_proxy.py
  • cd server && uv run ruff check src/api/lifecycle.py tests/test_routes_proxy.py

Fixes #383

@liuxiaopai-ai
Copy link
Contributor Author

@ninan-nn @Pangjiping This should fix issue #383. Could you please take a look when you have a moment? Thanks!

@Pangjiping
Copy link
Collaborator

@ninan-nn @Pangjiping This should fix issue #383. Could you please take a look when you have a moment? Thanks!

Thanks for this, I will review this feature.

@Pangjiping Pangjiping added feature New feature or request component/server labels Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/server feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: 使用沙盒server部署openclaw,并且客户端跨服务器创建ui正常访问但是websocket403

2 participants