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

Code for adding the project to bookmarks

Add the project to del.icio.us

http://del.icio.us/post?title=www.memosoup.com&url=http://www.memosoup.com

Post a project on digg.com

http://digg.com/submit?phase=2&url=http://www.memosoup.com

Add the site to bookmarks:

function add2Bookmarks(title,url) {
if (window.sidebar) {
window.sidebar.addPanel(title, url,"");
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}



bookmark
Put this site to Your bookmarks