Linux – squid with SSH dynamic redirect

linuxPROXYsquidsshUbuntu

I have a working SOCKS proxy, which I set up with the command ssh -D 9999 user@host. As mentioned, this works great, and when I browse the public IP is that of the server that I connected to via SSH.

My network overview is:

local pc –> server (local network, running ssh -D command) –> remote server (proxy)

I have run into an issue with a device that can only use a HTTP proxy, so I have set up squid on the local network server. I can access the proxy without any issues, but the IP address displayed is that of my local network, not the proxy.

How can I configure squid to use the socks proxy that I have set up via SSH?

Thanks!

Best Answer

Instead of Squid, consider using Privoxy or Polipo, which allows you to forward connections to a upstream SOCKS proxy.

[device]---8118---[privoxy/polipo]---1080---[socks proxy]---80---[http server]

That said, you may still need to