CONNECT

HTTP CONNECT

SafeNo
IdempotentNo
CacheableNo
Request bodyNo
Response bodyYes

Overview

CONNECT asks a proxy to open a two-way tunnel to the target server. It is used to pass HTTPS traffic through a forward proxy.

Details

When a browser reaches an `https://` site through a proxy, it first sends `CONNECT host:443` to establish a TCP tunnel; on success (200 Connection Established) the TLS handshake and encrypted traffic flow over it unchanged.

If the proxy needs authentication it requires `Proxy-Authorization` and returns 407 when missing. Application code rarely handles CONNECT directly — it is mainly a method of the proxy/tunneling infrastructure layer.

Request / Response example

Request
CONNECT example.com:443 HTTP/1.1
Host: example.com:443
Response
HTTP/1.1 200 Connection Established

In code

curl -x http://proxy:8080 https://example.com/   # curl이 내부적으로 CONNECT 사용

Common mistakes

Typical status codes

Related methods

Related headers

HostProxy-Authorization