web analytics

Template for proxy auto-config file

Proxy autoconfig file could be used in browser (Opera,FireFox,IE) to change the proxy dynamically.

var ALLOWED = "DIRECT";
var DISALLOWED = "PROXY 0.0.0.0:1234";

function FindProxyForURL(url, host)
{
if (shExpMatch(url,"*.badsite.com/*"))  {return DISALLOWED;}
var currentTime = new Date();// convert the current time to minutes
var now = 60*currentTime.getHours() + currentTime.getMinutes();

// Do not allow the access before 18:00
if (now < 18 * 60 ) {
return DISALLOWED ;
}
else
{
return ALLOWED ;
}

} // end of function

Additional examples

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.