[CentOS] remote ssh to machine how display firefox

Fri Dec 7 16:30:31 UTC 2007
Akemi Yagi <amyagi at gmail.com>

On Dec 7, 2007 7:53 AM, Jon Stanley <jonstanley at gmail.com> wrote:

> Or better yet use ssh -d <some local port> and set your local SOCKS
> proxy to localhost:<that port> in your browser.

Yes, the SOCKS proxy method is indeed handy and you can redirect only
selected URLs fairly easily.  In my case, there are web sites I can
access only from work computers and I need to get to them from home
but do not want to redirect all traffic through work.

Here is a brief howto.

ssh -D 1080 <my work IP>

In firefox, Go to Edit -> Preferences -> Advanced -> Network -> Settings

In the Connection Settings box, select "Automatic proxy configuration
URL:" and enter:

   file:///path/to/proxylist.pac

The proxylist.pac file may look like this:

function FindProxyForURL(url, host)
{
        // Proxy direct connections to these hosts
        if (
                shExpMatch(url, "http://www.jbc.com/*") ||
                shExpMatch(url, "*.sgmjournals.org/*") ||
                shExpMatch(url, "http://www.ncbi.nih.gov/*")
        ) {
                return "SOCKS localhost:1080; DIRECT";
        }
// Otherwise go directly
        else return "DIRECT";
}

For more details on the pac file and auto config, see

http://en.wikipedia.org/wiki/Proxy_auto-config

Akemi