CONNECT
Example
CONNECT https://example.com/ HTTP/1.1CONNECT example.com:443 HTTP/1.1
Host: example.com:443The CONNECT target is only a host and port; the proxy opens a TCP tunnel and TLS runs inside it.
Common mistakes
- Running a proxy that allows
CONNECTto any port, turning it into an open relay.
Key points
- The proxy allows
CONNECTonly to port 443 or an explicit allow list. - The proxy requires authentication before opening tunnels.
Interview questions
Can a proxy see HTTPS traffic sent through CONNECT?
No, it sees only the host and port, because TLS runs end to end. Only a proxy whose certificate authority the client trusts can intercept it.
Can fetch send a CONNECT request?
No, CONNECT is a forbidden method in fetch. Browsers send it themselves when a proxy is configured.