How can I set up squid to act as a tunneling proxy to expose a VPN or SSH tunnel?
5,186
First, Setup your ssh tunnel
ssh you@yourproxysever -L8080:localhost:8080
Leave this connection running, this assumes that your proxy server is listening on port 8080.
Second, Setup your web browser to use localhost:8080 as its proxy server
The ssh tunnel will forward packets to your proxy server over ssh.
Related videos on Youtube
Author by
aresnick
Updated on September 17, 2022Comments
-
aresnick over 1 year
I'd like to set up a tunneling proxy accessible by URL--so, to access
bar.com
through the tunneling proxy, you'd go tofoo.com/bar.com
and continue to browsebar.com
transparently from there. I can either set up an SSH tunnel or a VPN connection that I'd like to expose. How can I set up squid (or another proxy server) to route requests through an SSH/VPN connection like this? -
user1686 about 14 yearsUse
ssh -fN ...
to make it drop into background after connecting. -
aresnick about 14 yearsAwesome; thanks! How can I use this to expose that publicly? I'm not exactly clear on how I would set up a webserver to receive a request (say, on 80), forward it to the SSH tunnel, and pass the response back.
-
aresnick about 14 yearsSo what I'd like to do is something like: [browser]---[my webserver]---[ssh tunnel]---[proxy on remote machine]---[remote web server (whatever resource the user requests]
-
aresnick about 14 yearsTo finish that comment: it's not clear to me how to do that =)
-
sybreon about 14 yearsIn that case, your webserver would need to function as a reverse proxy with an upstream proxy configuration. You might be able to do it with some squid magic but I have a feeling that you will need to write your own server.