Repository navigation
net: fixes from the second interop round (Vision direct, ML-KEM for Reality, links, DoH h2, pre-auth limits, thread leak) - #3018
Conversation
… of the data Xray and sing-box switch to raw TCP after a direct command once the inner traffic is TLS 1.3, so the reader has to do the same. A frame that ended exactly at the end of a record was also only closed on the next read, which never comes after a direct command.
mode=multi on vless and trojan links and type=multi on vmess grpc links were dropped, so the client dialled gun against a multi server. The reality parameters (spx, alpn) were taken from the query without percent decoding.
Checked against python hashlib and Go crypto/mlkem: key generation from a seed, decapsulation of a foreign ciphertext, encapsulation and the implicit rejection key all agree.
…afari profiles send it The hybrid share was random bytes, so a Reality destination that picks X25519MLKEM768 (Google, Cloudflare, anything on OpenSSL 3.5) made the handshake fail with our client. The client now keeps the ML-KEM seed and decapsulates the server share. Xray also drops hellos without the hybrid share, so the firefox and safari profiles never authenticated.
Quad9's DoH endpoint only speaks HTTP/2 and answered every HTTP/1.1 query with 505, so the quad9 preset never resolved anything. The client now retries over h2 (ALPN h2, GET or POST) and remembers that the server needs it.
… source address A silent client used to stall the whole listener: the TLS handshake of a vless inbound and the websocket upgrade of a trojan one ran on the accept thread (15 s each), and a plain websocket upgrade had no deadline at all. Inbounds now go through transport.Accept, the trojan upgrade runs in the connection thread, the accept server deadline drops from 15 to 8 seconds, and each address may have at most 32 connections in their handshake.
… the new handshake defaults
Handshake, trojan connection, grpc reader and mux reader threads were spawned and never joined, so each kept its 8 MB stack. Every connection of a vpn server added 16 MB of address space and the server stopped accepting after a few hundred of them under a 4 GB limit. tunnel.Go starts a detached thread.
…tls echo for inner tls
The inbound handshake closes the stream on failure and the accept server closed it again. The second close hit the descriptor number, which the accept thread may already have given to a new connection, so a silent client connected right after a failed one was closed at once.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
sha=000a51fd782ab75014829eb29727068571fbaac3
🤖 Salam AI reviewVerdict: 🛠️ Changes needed before merging commit SummaryThis pull request delivers a large second interop round across the VPN, TLS, transport, and link layers, adding ML-KEM/SHA-3 support, Vision direct handling, DoH HTTP/2 fallback, per-source handshake limits, detached worker threads, and idempotent connection closes. The change is broad and appears to follow the documented fixes, but at least one concrete control-flow issue in transport direct switching should be corrected before merge. What changedThe PR updates many Review
TestsThe PR adds English and Persian tests for DoH HTTP/2, ML-KEM, transport double close, gRPC link mode, source limits, and Vision direct. I did not execute the compiler or tests, so I cannot confirm that all new and modified tests pass; the review is based on the supplied diff. RisksThe main risk is the apparent recursion in
|
Second round of checks against real Xray-core 26.11.9, sing-box 1.14.4 and shadowsocks-rust 1.25.0 (checksum-verified, loopback only), covering the features added since round one. The matrix, versions, bug list and rerun steps are in docs/VPN_INTEROP.md.
Bugs found and fixed:
Interop results (byte-exact 1 MiB echo both directions): gRPC gun and multi, Vision over TLS and Reality with inner TLS, Reality with empty flow, ClientHello fragmentation modes, Mux.Cool against Xray, Shadowsocks 2022 UDP and multi-user, Trojan UDP, and the round-one matrix rerun (87/88, the failure is VMess none against Xray 26.x which dropped it). Geo dat reader agrees with an independent Python reader on 15 categories of the real files.
Left: chrome_120 cannot authenticate against Xray 26.x (no hybrid share), outbound streamSettings.fragment in a JSON config is ignored on the client side (works through vpn.Options), handshake deadlines are per read, Mux.Cool over TLS/Reality and VLESS/VMess UDP untested.
Checked with a compiler built from main; new tests have Persian twins and docs cover every new public symbol in en and fa.