public class SocksProxy extends Proxy
SOCKS proxy client. Supported versions of the protocol are SOCKS4 and SOCKS5.
Constructor and Description |
---|
SocksProxy(String address,
int port)
Initializes a new instance of the
SocksProxy class to connect to SOCKS4 server without authentication. |
SocksProxy(String address,
int port,
byte version)
Initializes a new instance of the
SocksProxy class to connect to SOCKS4 or SOCKS5 server without authentication. |
SocksProxy(String address,
int port,
String userID)
Initializes a new instance of the
SocksProxy class to connect to SOCKS4 server without authentication. |
SocksProxy(String address,
int port,
String username,
String password)
Initializes a new instance of the
SocksProxy class to connect to SOCKS5 server with defined username and password. |
Modifier and Type | Method and Description |
---|---|
byte |
getSupportedAuthenticationMethods()
The supported authentication methods to connect to SOCKS server
|
byte |
getVersion()
Required SOCKS server version.
|
void |
setSupportedAuthenticationMethods(byte value)
The supported authentication methods to connect to SOCKS server
|
void |
setUpStream(com.aspose.ms.System.IO.Stream stream,
String address,
int port)
Configures proxy-server to transport data to the target host.
|
void |
setVersion(byte value)
Required SOCKS server version.
|
dispose, getAddress, getPassword, getPort, getStream, getUsername, setAddress, setPassword, setPort, setUsername
public SocksProxy(String address, int port)
Initializes a new instance of the SocksProxy
class to connect to SOCKS4 server without authentication.
address
- The domain name or IP address of the proxyport
- The port number of the proxypublic SocksProxy(String address, int port, byte version)
Initializes a new instance of the SocksProxy
class to connect to SOCKS4 or SOCKS5 server without authentication.
address
- The domain name or IP address of the proxyport
- The port number of the proxyversion
- Required SOCKS server version.public SocksProxy(String address, int port, String userID)
Initializes a new instance of the SocksProxy
class to connect to SOCKS4 server without authentication.
address
- The domain name or IP address of the proxyport
- The port number of the proxyuserID
- UserID for Socks4 Identification Protocol (RFC 1413)public SocksProxy(String address, int port, String username, String password)
Initializes a new instance of the SocksProxy
class to connect to SOCKS5 server with defined username and password.
address
- The domain name or IP address of the proxyport
- The port number of the proxyusername
- Username for authenticationpassword
- Password for authenticationpublic final byte getVersion()
Required SOCKS server version.
public final void setVersion(byte value)
Required SOCKS server version.
public final byte getSupportedAuthenticationMethods()
The supported authentication methods to connect to SOCKS server
public final void setSupportedAuthenticationMethods(byte value)
The supported authentication methods to connect to SOCKS server
public void setUpStream(com.aspose.ms.System.IO.Stream stream, String address, int port)
Configures proxy-server to transport data to the target host.
stream
- Stream which is connected to the proxy-server.address
- The network address of the target host we want to contactport
- The port number of the target host we want to contact