Advertisement
dereksir

Untitled

Mar 19th, 2024 (edited)
663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. public class Main {
  2.     public static void main(String[] args) {
  3.         //...
  4.  
  5.         // create a random number generator
  6.         Random random = new Random();
  7.         // generate a random index to select a proxy from the list
  8.         int randomIndex = random.nextInt(proxyList.size());
  9.         // select random proxy
  10.         String randomProxy = proxyList.get(randomIndex);
  11.  
  12.         // extract proxy host and port based on the random index
  13.         String PROXY_HOST = randomProxy.split(":")[0];
  14.         int PROXY_PORT = Integer.parseInt(randomProxy.split(":")[1]);
  15.    
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement