Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between a "Socks Proxy" and a "HTTP Proxy which supports CONNECT request"

I know a socks proxy is a proxy which just relays the traffic to the dst ip:port And a HTTP Proxy which support CONNECT request, it also just relays the traffic to the dest host in the http request header Is there any difference in their functions(efficiency eg)?

like image 545
Alexis Avatar asked May 11 '14 10:05

Alexis


3 Answers

They are both proxy protocols for layer 4, but...

  1. SOCKS can handle TCP and UDP
    HTTP CONNECT can handle only TCP

  2. SOCKS are not encrypted (note: authentication ≠ encryption)
    HTTP CONNECT can use TLS

  3. SOCKS are dedicated service
    HTTP CONNECT can be cloaked in normal HTTP service

like image 116
Sista Fiolen Avatar answered Oct 21 '22 02:10

Sista Fiolen


Both SOCKS and HTTPS proxies use the corresponding protocols (SOCKS and HTTP respectively).

These types of proxies offer almost the same functionality, with the difference that SOCKS proxy sits on a dedicated port and HTTPS proxy can be combined with HTTP proxy or even with an HTTP server (or other hybrid construct).

One more benefit of HTTPS proxy is that some admins block SOCKS proxies and allow HTTP/HTTPS connections, so it becomes possible to bypass NAT/firewall restrictions using HTTPS proxy.

On the other hand, some HTTPS proxies are configured to allow connections to remote HTTP and HTTPS hosts only (i.e. not to custom ports of other protocols).

like image 29
Eugene Mayevski 'Callback Avatar answered Oct 21 '22 02:10

Eugene Mayevski 'Callback


There's no difference in "efficiency". Once the downstream connection to the destination server is established, they'll behave exactly the same.

A SOCKS proxy is basically a TCP proxy. Any TCP connection can work via a SOCKS proxy. A HTTP proxy proxies HTTP requests. Only HTTP sessions can go over a HTTP proxy.

But there's a problem: In HTTPS, the session is encrypted, so the HTTP proxy won't allow it. Solution: Allow "HTTP CONNECT". This basically makes the HTTP proxy behave as a TCP proxy.

So basically, you can think of the functionality of an HTTP proxy (which supports HTTP CONNECT) as a super-set of the functionality of a SOCKS proxy. It does exactly what a SOCKS proxy does - and a bit more.

like image 45
Kal Avatar answered Oct 21 '22 00:10

Kal