English
Transports and multiplexing
Ours: modules/transports/{ws,grpc,http,httpupgrade,xhttp}, the shared code — modules/transports/transport. The kind is chosen by the key of the transport block; an unknown one — unknown transport `x`; available: ….
sing-box's V2Ray transports
| What | Status | Where | Verdict |
|---|---|---|---|
quic (the V2Ray QUIC transport) | no | no transport.quic kind is registered; the quic extension of modules/transports/transport is the dialer of XHTTP over HTTP/3, not the V2Ray QUIC transport; in subscriptions — unsupported QUIC transport (modules/config/subscriptions/src/links.rs) | rarely needed: removed in Xray, rare in subscriptions |
grpc | present: on top of our own h2, with grpc-status in trailers and grpc-go's answers to foreign requests; our own message length limit (16 MiB); the client sends User-Agent: grpc-go/1.48.0 | modules/transports/grpc, crates/proto/src/h2/grpc.rs | — |
grpc client: compression of its own messages, multiMode | no: we accept gzip-compressed and TunMulti, we send uncompressed in Tun ourselves | crates/proto/src/h2/grpc.rs | rarely needed |
http | present (h2 with TLS, h1 without) | modules/transports/http | — |
ws (with early data), httpupgrade | present | modules/transports/ws, httpupgrade | — |
The User-Agent of ws and httpupgrade clients | different: under utls — that of the browser with the same fingerprint and version (for random/randomized — the chosen one), without utls — Go-http-client/1.1, as in sing-box; sing-box sends the Go one even with a Chrome fingerprint. The other browser headers (Origin, Accept-Language, Sec-WebSocket-Extensions) are absent, the order is Go's | libs/tls13/src/presets.rs (user_agent), Setup::browser | — |
path of ws and httpupgrade, host of httpupgrade | different: path is the path itself on both sides: the client escapes every byte that needs it, % included, as Xray's httpupgrade client does; the server unescapes the request path and compares, as both references' servers do. sing-box's client takes path as already escaped: /a%20b goes out as is from it and as /a%2520b from ours. With early data in the path, the server compares the escaped path (sing-box compares it as written and refuses a path that needs escaping). A host outside visible ASCII is a configuration error: Go's client sends an IDN in punycode and Go's server refuses anything else | crates/proto/src/http1.rs (escape_path, path), modules/transports/{ws,httpupgrade} | — |
The fields of ws, grpc, http, httpupgrade match the reference's option/v2ray_transport.go by name.
| What | Status | Where | Verdict |
|---|---|---|---|
| The server's answers to foreign requests (another path, host, method, not HTTP) | present: as with the reference's Go net/http: the standard phrase, Date, Content-Length: 0, the connection stays open for the next request; on a ws path — the gobwas/ws texts | crates/proto/src/http1.rs (serve, refuse) | — |
| The same: the body of a refused request | different: chunked and a body larger than 256 KiB close the connection (Connection: close); Go skips up to 256 KiB and chunked | the same place | rarely needed |
The same: a head longer than 64 KiB, lines with a single \n | different: the connection is closed silently; Go answers 431 and accepts \n | the same place | rarely needed |
| The same in HTTP/2 | different: the fields are as in Go (content-length, date); the HPACK encoding (indexing, Huffman) is our own | modules/transports/http, xhttp | rarely needed |
Xray transports
| What | Status | Where | Verdict |
|---|---|---|---|
XHTTP (splithttp) | beyond the reference (sing-box) | modules/transports/xhttp | — |
XHTTP packet-up: the default scMinPostsIntervalMs pause | different: skipped when a full request is already queued; one set explicitly is always honoured | modules/transports/xhttp/src/client.rs (Posts::run) | — (in Xray the upload is capped at 1 MB per 30 ms, ~270 Mbit/s per connection) |
XHTTP scStreamUpServerSecs, serverMaxHeaderBytes, trustedXForwardedFor, congestionController, cwnd, h2Params | silent in subscriptions (server or QUIC parameters) | modules/config/subscriptions/src/xhttp.rs (IGNORED) | — |
XHTTP ranges (xPaddingBytes, uplinkChunkSize, sessionIDLength and others as from-to) | different: one value; from a subscription the lower bound is taken (for sessionIDLength — the upper one) | the same place | — |
XHTTP server: padding in the stream-up response every scStreamUpServerSecs | no: the response has no body until the upload ends | modules/transports/xhttp/src/server.rs | rarely needed: Xray clients do not expect it |
XHTTP HTTP/3 and download for trojan | no: only for vless | modules/protocols/vless/src/connector.rs | rarely needed: on request |
RAW/TCP with header.type: http | partial: read without TLS, over TLS — unsupported TCP header over TLS: http | modules/config/subscriptions/src/links.rs, xray.rs | rarely needed |
| mKCP | no | — | rarely needed: rare in subscriptions |
domainsocket, quic | no | — | junk: removed in Xray |
| XDRIVE (a tunnel through Google Drive or a templated HTTP backend) | no | — | rarely needed: appeared in v26.9.30 |
masque (CONNECT-IP as a transport) | no | — | rarely needed, together with the MASQUE endpoints (see protocols.md) |
finalmask (sudoku, header-*, mkcp-*, salamander outside Hysteria 2, xdns, xicmp, xmc, udpHop, realm) | no; fragment, noise — silent | modules/config/subscriptions/src/common.rs (masks) | fragment — do through TLS fragmentation; the rest — rarely needed |
Multiplexing (mux)
| What | Status | Where | Verdict |
|---|---|---|---|
smux, yamux, h2mux | present | modules/protocols/mux | — |
mux for vmess | no | see protocols.md | missing: together with vmess |