0

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
David Lor
  • 66
  • 4

1 Answers1

0

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";

    else
        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

and

$ ssh -D 9002 user@webui-host2.intranet
Eduardo Trápani
  • 1,140
  • 6
  • 10