Repository navigation
Description
Verified against (commit SHA or released version)
commit 988c035 (v0.14.0)
Discord Username / User ID
interferon0
What does this improvement do?
On a network whose only way out is an HTTP proxy, test run --local and tunnel start cannot work today. The CLI sends its API calls through HTTPS_PROXY, and the tunnel's control WebSocket goes through the same agent. The tunnel's data connection does not: it dials data.tun.testsprite.com:443 directly. On such a network that dial fails, the client retries for 60 seconds, and the command exits 10. The run is cancelled with advice about TLS interception, the system clock and port 443, none of which applies. The connect-timeout error even says "An HTTP proxy does not help here".
Reproduced with tunnel start against a local stand-in for the tunnel service whose data host does not resolve, so a CONNECT proxy is the only route to it (HTTPS_PROXY set, as on a locked-down corporate laptop or CI runner):
[tunnel] Tunnel t1 disconnected: getaddrinfo ENOTFOUND data.tunnel.test
... (20 times)
Error: The tunnel's encrypted data connection to data.tunnel.test:443 could not be established for 60s (last error: getaddrinfo ENOTFOUND data.tunnel.test). Corporate TLS interception, a wrong system clock, or a firewall blocking port 443 are the usual causes; ...
The proxy never saw a single CONNECT.
Details / implementation notes
Proposed:
- When the CLI's proxy agent is active, the TLS data connection opens an HTTP
CONNECTtunnel to the data-plane host through the proxy and runs its TLS handshake inside it. Certificate verification and SNI still name the tunnel server, so the proxy relays only encrypted bytes and never sees the tunnel secret. - The proxy is chosen with the rules undici already applies to API traffic:
https_proxy/HTTPS_PROXY, thenhttp_proxy/HTTP_PROXY, withNO_PROXYexemptions.user:password@credentials becomeProxy-Authorization: Basic. - The CONNECT exchange uses undici's
Client.connect(already a dependency), not a hand-written HTTP parser. - stderr names the proxy once (host and port, never credentials). A refused CONNECT names the proxy and the HTTP status, and the final error points at the proxy settings instead of the TLS trust store.
- The vendored tunnel client gets one optional option (
dataPlaneStream) documented as a numbered delta inVENDOR.md. Without it, the dial is unchanged. - Out of scope: SOCKS proxies and the legacy plaintext transport keep a direct connection, and stderr says so.
Confirmations
- I have searched existing issues and this is not a duplicate.
- I have provided my Discord identity above for reward coordination.
Activity
fyZhang66 commentedon Oct 20, 2026
Thanks — the analysis is right: the control WebSocket honours
HTTPS_PROXYbut the data connection dialsdata.tun.testsprite.com:443directly. Supporting a proxy there is a change to the tunnel service and the tunnel client protocol together, not something that can land in this repo alone, so we're taking it on our side and tracking it internally. Closing here; we'll note it in the changelog when it ships.