Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- import java.net.*;
- public class Test {
- public static List<ProxyService> proxies = new ArrayList<ProxyService>();
- public static void main(String[] args) throws IOException{
- readProxies("C:\\Users\\samsung\\Desktop\\http-10000.txt");
- }
- public static void readProxies(String fileName) throws IOException {
- FileReader fr = new FileReader(fileName);
- BufferedReader br = new BufferedReader(fr);
- String s;
- while ((s = br.readLine()) != null) {
- String[] spl = s.split(":");
- String host = spl[0];
- int port = Integer.parseInt(spl[1]);
- ProxyService ps = new ProxyService();
- ps.setHost(host);
- ps.setPort(port);
- proxies.add(ps);
- }
- }
- public static void setConnection(URL url) {
- }
- public static class ProxyService{
- private String host;
- private int port;
- public String getHost() {
- return host;
- }
- public int getPort() {
- return port;
- }
- public void setHost(String host) {
- this.host = host;
- }
- public void setPort(int port) {
- this.port = port;
- }
- }
- }
- class ProxyThread extends Thread {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement