/** * Creates a no authentication SOCKS5 server. * * @param port The port that SOCKS5 Server will listen. * @return The instance of {@link SocksProxyServer} that supports SOCKS5 protocol. */ public static SocksProxyServer newNoAuthenticationServer(int port) { SocksProxyServer proxyServer = new BasicSocksProxyServer(Socks5Handler.class, port); proxyServer.setBufferSize(BUFFER_SIZE); proxyServer.setTimeout(TIMEOUT); proxyServer.setSupportMethods(new NoAuthenticationRequiredMethod()); return proxyServer; }
/** * Creates a no authentication SOCKS5 server. * * @param port The port that SOCKS5 Server will listen. * @return The instance of {@link SocksProxyServer} that supports SOCKS5 protocol. */ public static SocksProxyServer newNoAuthenticationServer(int port) { SocksProxyServer proxyServer = new BasicSocksProxyServer(Socks5Handler.class, port); proxyServer.setBufferSize(BUFFER_SIZE); proxyServer.setTimeout(TIMEOUT); proxyServer.setSupportMethods(new NoAuthenticationRequiredMethod()); return proxyServer; }
public static SocksProxyServer newUsernamePasswordAuthenticationServer(int port, User... users) { SocksProxyServer proxyServer = new BasicSocksProxyServer(Socks5Handler.class, port); proxyServer.setBufferSize(BUFFER_SIZE); proxyServer.setTimeout(TIMEOUT); UsernamePasswordAuthenticator authenticator = new UsernamePasswordAuthenticator(); for (User user : users) { authenticator.addUser(user.getUsername(), user.getPassword()); } proxyServer.setSupportMethods(new UsernamePasswordMethod(authenticator)); return proxyServer; }
public static SocksProxyServer newUsernamePasswordAuthenticationServer(int port, User... users) { SocksProxyServer proxyServer = new BasicSocksProxyServer(Socks5Handler.class, port); proxyServer.setBufferSize(BUFFER_SIZE); proxyServer.setTimeout(TIMEOUT); UsernamePasswordAuthenticator authenticator = new UsernamePasswordAuthenticator(); for (User user : users) { authenticator.addUser(user.getUsername(), user.getPassword()); } proxyServer.setSupportMethods(new UsernamePasswordMethod(authenticator)); return proxyServer; }
proxyServer.setSupportMethods(methods); if (proxy != null) { proxyServer.setProxy(proxy);
proxyServer.setSupportMethods(methods); if (proxy != null) { proxyServer.setProxy(proxy);