[Feature suggestion & draft] Redesigned browser dialer
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- go, javascript
- Domain
- networking, web-dev
Research direction
No source files, tests, or implementation entry points are named. Start by reading the referenced issue #3832, then review the proposed /control and /data routes and the browser-side behavior in this issue. The design is explicitly unfinished, so completion criteria are not yet defined.
Written by the indexing model from the issue text.
Description
A continuation of #3832. Aimed at maximizing throughput and minimizing resource consumption on the browser side, and also potentially allowing arbitrary headers with the browser dialer.
Prerequisites
This draft is designed with the following assumptions.
- The web server implementation in Go supports routable HTTP servers with streaming and WebSocket support.
- The implementation of maps in Go is 💫 blazingly fast 💫.
- The user has a recent installation of a modern browser (Chromium, Firefox or Safari).
Design
Still not fleshed out. Critiques are welcomed!
Web routes
WS /control
The control plane. This is the only place where any form of processing can happen with all possible latest web features. Xray can command the browser dialer on what and how to connect through it. If request bodies from Meek-like transports are not streamed, this should also carry the body of the request.
Message structure
| Byte length | Required? | Use |
|---|---|---|
4 (uint32) |
Y | Length of payload. MSB to eliminate uncertainty of endianness with a somewhat fast implementation, or LSB to maximize speed. Should always be 0 for WebSocket connections and streamed web requests. |
| variable | Y | JSON-encoded command. |
| variable | N | Raw payload. Currently only used by non-streamed requests to post to remote. |
Commands
{
"m": "WS", // Method, can be "WS", "GET" or "POST"
"p": "", // A string or an array of strings for expected **WebSocket** protocols
"r": "", // Remote URL
"i": 65535, // A numerical (positive integer) or a web-safe random string ID to distinguish connections
"h": {} // A map of non-restricted custom headers to send to the server, cannot be used for WebSocket
}
WS /data?id=<socketId>
For Chrome 124 and later. Where contents of WebSocket connections are passed through without any processing.
GET/POST /data?id=<socketId>
For Chrome 105 and later. Where contents of all web-compliant connections are passed through without any processing. Has the exact same use as above, only that for each duplex connection, a get-post pair is created due to browsers refusing to support HTTP/2 cleartext.
Send ReadableStream in request body - caniuse.com
Browser-side behaviour
| Criteria | WebSocket behaviour |
|---|---|
WebSocketStream |
WebSocketStream pass-through 1 |
| Anything else | Iterated WebSocket |
| Criteria | Meek-like behaviour |
|---|---|
| Chrome 105+ | Request stream pass-through |
| Anything else | Iterated bodies (memory leak) |
- 1: Using streamed requests instead of streamed WebSocket on the local machine may yield better performance, as instead of native piping, server to client messages could all be in pass-through.
- Dominant language
- Go
- Stars
- 43.3k
- Forks
- 6.2k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 55
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from XTLS/Xray-core
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openclaw/crabbox#3249 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
ec2-subnet, security-group and internet-gateway skip all resources when one is deleted during the scanPossibly taken @toabctl claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
gruntwork-io/cloud-nuke#1208 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
snowflakedb/gosnowflake#1872 ·
-
MCP `shadow` says `out` is a folder, but for TS, Python, C, Go and Ruby it is the module's fileOpengood first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
erkamyaman/rust-anything#1328 ·
Maintainers usually reply within 1 day