/** * Constructs a Socks5 instance. * * @param socketAddress SOCKS5 server's address. * @param username Username of the authentication. * @param password Password of the authentication. */ public Socks5(SocketAddress socketAddress, String username, String password) { this(socketAddress); setCredentials(new UsernamePasswordCredentials(username, password)); }
/** * Constructs a Socks5 instance. * * @param socketAddress SOCKS5 server's address. * @param username Username of the authentication. * @param password Password of the authentication. */ public Socks5(SocketAddress socketAddress, String username, String password) { this(socketAddress); setCredentials(new UsernamePasswordCredentials(username, password)); }
@Override public void read(InputStream inputStream) throws SocksException, IOException { version = checkEnd(inputStream.read()); usernameLength = checkEnd(inputStream.read()); username = readString(inputStream, usernameLength); passwordLength = checkEnd(inputStream.read()); password = readString(inputStream, passwordLength); credentials = new UsernamePasswordCredentials(username, password); }
@Override public void read(InputStream inputStream) throws SocksException, IOException { version = checkEnd(inputStream.read()); usernameLength = checkEnd(inputStream.read()); username = readString(inputStream, usernameLength); passwordLength = checkEnd(inputStream.read()); password = readString(inputStream, passwordLength); credentials = new UsernamePasswordCredentials(username, password); }
user = values[0].split(":"); address = values[1].split(":"); credentials = new UsernamePasswordCredentials(user[0], user[1]);
user = values[0].split(":"); address = values[1].split(":"); credentials = new UsernamePasswordCredentials(user[0], user[1]);
Socks5 proxy = new Socks5(new InetSocketAddress(proxyHost, proxyPort)); if (username != null && password != null) { proxy.setCredentials(new UsernamePasswordCredentials(username, password));
Socks5 proxy = new Socks5(new InetSocketAddress(proxyHost, proxyPort)); if (username != null && password != null) { proxy.setCredentials(new UsernamePasswordCredentials(username, password));
Socks5 proxy = new Socks5(new InetSocketAddress(proxyHost, proxyPort)); if (username != null && password != null) { proxy.setCredentials(new UsernamePasswordCredentials(username, password));
Socks5 proxy = new Socks5(new InetSocketAddress(proxyHost, proxyPort)); if (username != null && password != null) { proxy.setCredentials(new UsernamePasswordCredentials(username, password));
return new Socks5(host, port); } else { return new Socks5(host, port, new UsernamePasswordCredentials(username, password)); socks = new SSLSocks5(new InetSocketAddress(host, port), configuration); if (!Strings.isNullOrEmpty(username)) { socks.setCredentials(new UsernamePasswordCredentials(username, password)); socks = new SSLSocks5(new InetSocketAddress(host, port), configuration); if (!Strings.isNullOrEmpty(username)) { socks.setCredentials(new UsernamePasswordCredentials(username, password));
return new Socks5(host, port); } else { return new Socks5(host, port, new UsernamePasswordCredentials(username, password)); socks = new SSLSocks5(new InetSocketAddress(host, port), configuration); if (!Strings.isNullOrEmpty(username)) { socks.setCredentials(new UsernamePasswordCredentials(username, password)); socks = new SSLSocks5(new InetSocketAddress(host, port), configuration); if (!Strings.isNullOrEmpty(username)) { socks.setCredentials(new UsernamePasswordCredentials(username, password));