Rotate IPs

From FoxyProxy Documentation
Revision as of 14:45, 9 May 2013 by Ejung (Talk | contribs)

Jump to: navigation, search

How to use a PAC file to automatically rotate IPs

This PAC script round-robin rotates through X number of proxies every Y seconds.

  • You must hard-code the list of proxies in the PAC file :(
  • The secondsToSwitchAfter variable controls how frequently the proxies should be rotated
 // PAC file to switch IP addresses every 3 seconds across 5 IP addresses

 var proxies = ["PROXY", "PROXY",
  t1 = new Date().getTime(), counter = 1;

 var secondsToSwitchAfter = 3;

 function FindProxyForURL(url, host) {
   var t2 = new Date.getTime();
   if (t2 - t1 > secondsToSwitchAfter * 1000)
   t1 = t2;
   return proxies[counter % proxies.length];