Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- //...
- // create a random number generator
- Random random = new Random();
- // generate a random index to select a proxy from the list
- int randomIndex = random.nextInt(proxyList.size());
- // select random proxy
- String randomProxy = proxyList.get(randomIndex);
- // extract proxy host and port based on the random index
- String PROXY_HOST = randomProxy.split(":")[0];
- int PROXY_PORT = Integer.parseInt(randomProxy.split(":")[1]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement