-
-
Save laocoi/12a6729d706a773937c2cc2f959cbbc5 to your computer and use it in GitHub Desktop.
A PAC file that picks a random proxy from a list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
By Daan Rijks (daanrijks@gmail.com). | |
Idea & Inititative: Niels Meijer (niels.meijer@leerling.ig.nl) | |
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License | |
(http://creativecommons.org/licenses/by-nc-sa/4.0/) | |
*/ | |
var hosts = ""; // HTTP proxies go here, in the format host:port separated by a single space. | |
function FindProxyForURL(url, host) | |
{ | |
var hostsArray = hosts.split(" "); | |
var randomIndex = Math.floor((Math.random() * hostsArray.length)); | |
return "PROXY " + hostsArray[randomIndex] + "; DIRECT"; // DIRECT makes the browser use no proxy if the chosen proxy doesn't work | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment