Auto rotate/cycle proxies

Post support and help questions here.

Re: Auto rotate/cycle proxies

Postby Schjmn » Fri Nov 18, 2016 11:15 am

Hi,

thanks, now it works! But the IP changes every 1-2 seconds. I want the IP to stay the same until Firefox closes. That's what I meant with:

How can I configure it to use a random proxy every time firefox starts up? Not after X seconds or for each URL.
Schjmn
 
Posts: 9
Joined: Mon Nov 14, 2016 2:39 pm

Re: Auto rotate/cycle proxies

Postby admin » Fri Nov 18, 2016 4:39 pm

Hi,

Here is the PAC code for that:

EDIT: small performance improvement.

Code: Select all
/ Random.
// Select a random proxy from an array, and always use it until the PAC code goes out of scope

// Define proxy list first
var proxies = ["PROXY myproxy.foo.com:9050", "PROXY myproxy.bar.com:8080", "PROXY myproxy.baz.com:6667"]; // CHANGE ME!

/**
 * Returns a random integer between min (inclusive) and max (inclusive)
 * Using Math.round() will give you a non-uniform distribution!
 * http://stackoverflow.com/questions/1527803/generating-random-whole-numbers-in-javascript-in-a-specific-range
 */
function getRandomInt(min, max) {
   return Math.floor(Math.random() * (max - min + 1)) + min;
}

var theProxy = proxies[getRandomInt(0, proxies.length-1)];
function FindProxyForURL(url, host) {
   return theProxy;
}

admin
Site Admin
 
Posts: 77
Joined: Tue Nov 30, 2010 9:02 pm

Re: Auto rotate/cycle proxies

Postby Schjmn » Fri Nov 18, 2016 5:31 pm

Now I get this error:

unterminated regular expression literal
Schjmn
 
Posts: 9
Joined: Mon Nov 14, 2016 2:39 pm

Re: Auto rotate/cycle proxies

Postby Schjmn » Sat Nov 19, 2016 2:43 pm

Got it! A very big THANK YOU! You were a huge help!!! :D
Schjmn
 
Posts: 9
Joined: Mon Nov 14, 2016 2:39 pm

Re: Auto rotate/cycle proxies

Postby admin » Sun Nov 20, 2016 9:18 pm

You're welcome. By the way, I made a small performance improvement to the code by editing the original.
admin
Site Admin
 
Posts: 77
Joined: Tue Nov 30, 2010 9:02 pm

Re: Auto rotate/cycle proxies

Postby Schjmn » Mon Nov 28, 2016 4:23 pm

Is it possible to use username/password protected proxies with the .pac file? If yes, only HTTP proxies or also SOCKS?
Schjmn
 
Posts: 9
Joined: Mon Nov 14, 2016 2:39 pm

Re: Auto rotate/cycle proxies

Postby admin » Mon Nov 28, 2016 6:02 pm

I honestly don't remember without reading the PAC specification. If it's supported by Firefox, it is supported in the FoxyProxy extension. The format would be:

SOCKS username@password:servername:port
or
PROXY username@password:servername:port (for http proxies)

e.g.

Code: Select all
return "PROXY foo@bar:homeslice.getfoxyproxy.org:8080";


for what it's worth, I've put this into the new Firefox proxy API specification. So, if it's not supported now, it will be in the future:
https://docs.google.com/document/d/1W45 ... waUI/edit#
https://bugzilla.mozilla.org/show_bug.cgi?id=1295807

Eric
admin
Site Admin
 
Posts: 77
Joined: Tue Nov 30, 2010 9:02 pm

Re: Auto rotate/cycle proxies

Postby ledgescha » Wed Feb 08, 2017 12:29 pm

With ***(removed)**** you are able to rotate proxy servers by time interval using the "next fastest available server" criteria.
ledgescha
 
Posts: 1
Joined: Wed Feb 08, 2017 12:27 pm

Re: Auto rotate/cycle proxies

Postby pservices69 » Mon Jul 03, 2017 12:34 pm

i thinks this is not possible
pservices69
 
Posts: 1
Joined: Mon Jul 03, 2017 12:30 pm

Previous

Return to Help and Support

cron