-
-
Save asasuou/b954a00afbc5c684c69b 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 ([email protected]). | |
Idea & Inititative: Niels Meijer ([email protected]) | |
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