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.
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.
CONNECT example.com:443 HTTP/1.1
Host: example.com:443HTTP/1.1 200 Connection Establishedcurl -x http://proxy:8080 https://example.com/ # curl이 내부적으로 CONNECT 사용