In the cURL documentation, there is an option called CURLOPT_HTTPPROXYTUNNEL
which is defined to create a tunnel via the proxy when enabled.
However, I have no idea what the tunnel is and what does it do. What difference will it make if I don't use a tunnel like this?
curl_setopt($session, CURLOPT_HTTPPROXYTUNNEL, 1)
UPDATE:
What I got is that the tunnel is referring to an HTTP CONNECT METHOD
and here is what I understand it does:
An HTTP-based tunneling method uses the HTTP CONNECT method/command. A client issues the HTTP CONNECT command to an HTTP proxy. The proxy then makes a TCP connection to a particular server:port, and relays data between that server:port and the client connection. Because this creates a security hole, CONNECT-capable HTTP proxies commonly restrict access to the CONNECT method. The proxy allows access only to a whitelist of specific authorized servers.
So, the question is, what is the difference between connecting to a proxy with and without CONNECT method?
CONNECT
on unencrypted ports (such as 80), you can also useCONNECT
forhttp://
urls just fine. – Afteryears