I have been looking into utilities which enable tunneling (SSH or otherwise) through an HTTP proxy:

I've not actually ever used any of them, though. It is not clear to me how these differ in terms of how they actually set the tunnel up. I'm interested both in the simpler case of HTTP and the more complex case of HTTPS.

I do know that httptunnel has two complementing components, one being a server-side perl script, while corkscrew and proxytunnel are only client-side IIANM. Still, the details of how the tunnel is set up escape me.


I've not used the other two, but corkscrew connects to the proxy and uses the CONNECT HTTP verb to request the proxy connects to the remote resource without doing any further HTTP protocol. Any traffic sent/received after the connection is established is transmitted as-is.

This is exactly the same as how regular HTTP clients behind a proxy connect to SSL/TLS websites, just instead of port 443 it's port 22, or some other port.

| improve this answer | |
  • But what happens at the IP and TCP levels after you've issued the CONNECT verb? Is it just the proxy opening up a connection with the target, and relaying octets between the client and the target as though they were connected directly? Also, about your second paragraph - is it different from how regular clients behind a proxy connect to non-TLS websites? – einpoklum Nov 4 '19 at 11:12
  • 1
    The proxy isn't a router so IP packets aren't forwarded; your client makes a connection to the proxy, the proxy makes a separate connection to the destination and the bytes are forwarded back and forth between the two connections. It is different from non-TLS websites in that for those, your client sends the GET, POST, etc. to the proxy and the proxy makes that request for you on your behalf (possibly caching the response, etc.) whereas for TLS or anything else using a CONNECT tunnel the proxy is literally just forwarding bytes, (a proxy can intercept TLS with some extra configuration). – bodgit Nov 4 '19 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.