Definition
CONNECT is an HTTP request method that asks an intermediary to establish a tunnel to a destination host and port. A successful response switches the connection to bidirectional data forwarding.
How the tunnel begins
In HTTP/1.1, an illustrative request line is CONNECT example.com:443 HTTP/1.1. The request target contains the destination host and an explicit port, rather than a normal page path. RFC 9110 requires the port to be present.
A successful 2xx response means the connection switches to tunnel mode after the response header section. A non-success response means the tunnel has not yet been formed. This first response belongs to tunnel setup; it is not the response to the eventual HTTPS page request.
What happens inside
After tunnel establishment, a client can negotiate TLS with the destination and send its application request through the resulting protected connection. The proxy relays bytes. CONNECT does not itself make those bytes encrypted, validate application content, or establish a website login.
A proxy may require authentication before allowing the tunnel. A 407 challenge at this stage concerns access to the proxy. Once the tunnel is active, the destination can independently return its own authentication or permission response.
Why a tunnel can be refused
A service may allow only particular destination ports or hosts. RFC 9110 recommends restricting CONNECT targets because unrestricted tunnels can be misused. A refused tunnel therefore does not prove a broken proxy or an unavailable destination.
For diagnosis, record whether failure happened before CONNECT, during the proxy response, during TLS, or after the application request. Remove authentication data from diagnostics before sharing them.
Sources
Sources checked on November 18, 2026. Examples are illustrative, not measurements of a live proxy service.
Related concepts
Frequently asked questions
Is CONNECT success the same as a successful page download?
No. It confirms tunnel establishment. TLS and the destination request can still fail afterward.
Can CONNECT use any destination port?
Only if allowed by the proxy policy and supported by the client. The protocol requires an explicit port; it does not guarantee permission.
Does a CONNECT tunnel cache the HTTPS page?
An ordinary blind tunnel does not interpret the encrypted page. RFC 9110 also specifies that CONNECT responses are not cacheable.