Automatic proxy selection based on network location with Firefox (proxy.pac)
From: Sébastien Pierrel (sebastien.pierrel_at_gmail.com)
Date: 11/30/05
- Previous message: T: "Can't startx in 24b color depth mode"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 30 Nov 2005 01:48:57 +0200 To: debian-user@lists.debian.org
Hi all,
I'm tired of changing my proxy settings everytime I move to a
different network with my laptop. Therefore, I'm writting an automated
script (proxy.pac):
----------------------------------8<-----------------------------------
function FindProxyForURL(url, host)
{
var company_net = "x.x.x.x";
var company_mask = "255.255.255.0";
if(isInNet(myIpAddress(), company_net, company_mask)) {
return "PROXY proxy.company.com:8080;";
}
return "DIRECT;";
}
----------------------------------8<-----------------------------------
well, the actual script is a *little* more complicated but this is
just enough to illustrate my problem:
isInNet(myIpAddress() always returns the loopback address (127.0.0.1)
Is that a bug from firefox? (Debian package 1.0.7-1)
How could I possibly check other interfaces' address? (lan, wlan, ppp...)
Thx,
/Seb.
- Previous message: T: "Can't startx in 24b color depth mode"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: Repeat with pause
... var start = new Date.getTime; ... var cur = start ... Possibly
the host will break your script to prevent that. ... (comp.lang.javascript) - Re: window object
... Within a script, every reference to an object amounts to two ... calls
from the scripting engine to the DHTML Object Model. ... var sText = document.all.div1.innerText;
... (comp.lang.javascript) - Re: Change IP related values due to WAN design change
... Unknown network, ... For the cost of testing a dangerous script in a
big ... > recurse your text file into an array. ... > var newSettings
= new NetworkSettings; ... (microsoft.public.windows.server.scripting) - Re: problem with logoff script
... the script engine as a process on the workstation and should execute cleanly ...
var fso = new ActiveXObject; ... sho.popup('An error occured attempting to get the Operating
System Type. ... // Retrieve the script application ... (microsoft.public.win2000.group_policy) - Re: Script for adding and deleting rows to a table
... that is one long script. ... var numRows = document.getElementById.rows.length;
... //Get Reference to cell that needs to be changed ... (comp.lang.javascript)