automatic proxy configuration in firefox

Nikolaus Gradwohl2007-11-03T15:43:00+00:00

In an erlier article i describe how to switch between the network environments i am using, but there was one programm i could not convince to let me change the proxy settings via apple script - firefox.

i still needet to switch the firefox settings per hand - something i didnt like at all.

one day the little "fetch proxy settings for url" dialog part from the firefox proxysettigns made me courious and i found out, that firefox expects a javascript file on this url, which tells firefox what proxy to use.

function FindProxyForURL(url, host) {
    if ( dnsResolve( host ) == "127.0.0.1" ) {
        return "DIRECT";
    } else {
        return "PROXY proxyhost:8080";
    }
}

this script can use some predefined functions like "isInNet" or "dnsResolve" to determine which network Im in and use the appropriate proxy. the file doesnt even have to live on a http server, a file:// url is sufficient.

e voila - no more manual proxy switching

Tweet This! submit to reddit Digg! Tags: | 1 comments | no trackbacks

See also:

Bitwig Studio Controllerscript for SoftStep2
A Bitwig-Studio Controller Script for Yamaha MX49 and MX61 (Version2)
Javascript and Typescript link-collection
A Bitwig-Studio Controller Script for Yamaha MX49 and MX61
Lightbox-Effekt for Processing-Sketches

Trackbacks

Comments

Leave a response

  1. Oyun 2009-11-01T20:50:29+00:00

    thanks admin. nice good article.

Leave a comment