SOCKS proxy to SSH server behind HTTP proxy
Solution 1:
You would do a lot better to "forward" the remote network's proxy server over SSH rather than using the built-in SOCKS server (which just expects a bare gateway-addressable network at the other end).
ssh -L 8080:internal_ip_of_proxy:8080 user@ssh_server
This exposes the proxy server locally, allowing you to set your browser's proxy settings to localhost:8080
and that will tunnel over SSH to the remote proxy.
And you can apply this to any remote service. You could, for example, tunnel Imgur from your server (in effect a single-host proxy):
ssh -L 8080:imgur.com:80 user@ssh_host
And on a local terminal:
curl --header 'Host: imgur.com' localhost:8080
The Host header is required otherwise curl
will request a non-existent localhost
site. You could also work around that by adding a line in /etc/hosts
, resolving imgur.com
to 127.0.0.1
... But I'm getting off-topic, you don't need any of this for your purposes.