At this moment I am using a SSH tunnel (which provides a socks5 proxy on the client host) to connect to a remote server and its network. I need to access different WebUI services, so I'm using a Firefox profile to set up the proxy settings to go through the SSH proxy.

Now, I need to do the same with another server. This means I'm dealing with 3 different Firefox instances, which can be a quite messy.

I remember having used some free proxy services that you can use from your browser without changing any setting, just entering the URL you want to go preceded by the proxy service's. For example, to go to google.com through the proxy, you would go to something like http(s)://fake-proxy-provider.fake/?https://www.google.es

Is there any way to do something like this on my local host? In short:

  • With my normal Firefox instance (with no proxy configured) I go to somewhere like http://localhost:8080/?https://www.google.com
  • This will request https://www.google.com through a socks5 proxy
  • 1
    You could set the SOCKS5 proxy in Firefox proxy settings. – Eduardo Trápani Apr 19 at 21:07
  • @EduardoTrápani That's what I do and what I would like to avoid. – David Lor Apr 20 at 6:16
  • For now I might be using this Firefox plugin: addons.mozilla.org/es/firefox/addon/container-proxy – David Lor Apr 21 at 7:26
  • That's a good one. You'd have to create the containers and set the proxies in each Firefox instance. I thought you wanted to centralize the configuration. It could be automated though. – Eduardo Trápani Apr 21 at 18:39

You could use a proxy autoconfig (PAC) file. It has a single javascript function that receives the URL and returns the proxy (if any) that Firefox should use to access it. Check the link to see what built-in functions you have. You can make it as complicated as you want, just keep in mind that it will be called for each request.

Note that the PAC file can be hosted somewhere, meaning you will only have to deal with a single instance.

An example:

function FindProxyForURL(url, host) {

    if (host == "webui-host1.intranet")
        return "SOCKS5 localhost:9001";

    else if (host == "webui-host2.intranet")
        return "SOCKS5 localhost:9002";

        return "DIRECT";

In this case webui-host1.intranet will use the SOCKS5 server at localhost:9001 and webui-host2.intranet will use the SOCKS5 server at localhost:9002. The rest of the urls will not use a proxy.

Then, you will probably have something like this:

$ ssh -D 9001 user@webui-host1.intranet


$ ssh -D 9002 user@webui-host2.intranet
| improve this answer | |

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.