I'm wondering if it would be possible to randomize proxy usage using the code below. All of the proxies I plan to use have the same port, same login, but of course different IPs.
I'm also having issues with the proxy actually working, even without randomizing. When I test, it's still using my main IP.
Here's the code I'm trying to work with:
public class RandomIP {
public static void main (String [] args) {
String [] proxyIP = {"123", "213", "314", "415"};
Random random = new Random();
int select = random.nextInt(proxyIP.length);
System.out.println("Proxy selected: " + proxyIP[select]);
}
How could I implement this with my main program, what line would I need to add to have it reference to this? The program loops so of course I would want it to be a different IP every time.
Aucun commentaire:
Enregistrer un commentaire