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

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.