chainProxy, defaultProxy, directHosts, in, out, proxyHost, proxyIP, proxyPort, proxySocket, SOCKS_ADDR_NOT_SUPPORTED, SOCKS_AUTH_FAILURE, SOCKS_AUTH_NOT_SUPPORTED, SOCKS_BADCONNECT, SOCKS_BADNETWORK, SOCKS_CMD_NOT_SUPPORTED, SOCKS_CONNECTION_REFUSED, SOCKS_DIRECT_FAILED, SOCKS_FAILURE, SOCKS_HOST_UNREACHABLE, SOCKS_JUST_ERROR, SOCKS_METHOD_NOTSUPPORTED, SOCKS_NO_PROXY, SOCKS_PROXY_IO_ERROR, SOCKS_PROXY_NO_CONNECT, SOCKS_SUCCESS, SOCKS_TTL_EXPIRE, version
Constructor and Description |
---|
Socks5Proxy(InetAddress proxyIP,
int proxyPort)
Creates SOCKS5 proxy.
|
Socks5Proxy(Proxy p,
InetAddress proxyIP,
int proxyPort)
Creates SOCKS5 proxy.
|
Socks5Proxy(Proxy p,
String proxyHost,
int proxyPort)
Creates SOCKS5 proxy.
|
Socks5Proxy(String proxyHost,
int proxyPort)
Creates SOCKS5 proxy.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a clone of this Proxy.
|
protected Proxy |
copy() |
protected ProxyMessage |
formMessage(InputStream in) |
protected ProxyMessage |
formMessage(int cmd,
InetAddress ip,
int port) |
protected ProxyMessage |
formMessage(int cmd,
String host,
int port) |
Authentication |
getAuthenticationMethod(int methodId)
Get authentication method, which corresponds to given method id
|
boolean |
resolveAddrLocally()
Get current setting on how the addresses should be handled.
|
boolean |
resolveAddrLocally(boolean doResolve)
Wether to resolve address locally or to let proxy do so.
|
boolean |
setAuthenticationMethod(int methodId,
Authentication method)
Adds another authentication method.
|
protected void |
startSession() |
accept, addDirect, addDirect, addDirect, bind, bind, connect, connect, endSession, exchange, getChainProxy, getDefaultProxy, getDirect, getInetAddress, getPort, isDirect, isDirect, parseProxy, readMsg, sendMsg, setChainProxy, setDefaultProxy, setDefaultProxy, setDefaultProxy, setDefaultProxy, setDefaultProxy, setDirect, toString, udpAssociate, udpAssociate
public Socks5Proxy(Proxy p, String proxyHost, int proxyPort) throws UnknownHostException
p
- Proxy to use to connect to this proxy, allows proxy chaining.proxyHost
- Host on which a Proxy server runs.proxyPort
- Port on which a Proxy server listens for connections.UnknownHostException
- If proxyHost can't be resolved.public Socks5Proxy(String proxyHost, int proxyPort) throws UnknownHostException
proxyHost
- Host on which a Proxy server runs.proxyPort
- Port on which a Proxy server listens for connections.UnknownHostException
- If proxyHost can't be resolved.public Socks5Proxy(Proxy p, InetAddress proxyIP, int proxyPort)
p
- Proxy to use to connect to this proxy, allows proxy chaining.proxyIP
- Host on which a Proxy server runs.proxyPort
- Port on which a Proxy server listens for connections.public Socks5Proxy(InetAddress proxyIP, int proxyPort)
proxyIP
- Host on which a Proxy server runs.proxyPort
- Port on which a Proxy server listens for connections.public boolean resolveAddrLocally(boolean doResolve)
SOCKS5 protocol allows to send host names rather then IPs in the requests, this option controls wether the hostnames should be send to the proxy server as names, or should they be resolved locally.
doResolve
- Wether to perform resolution locally.public boolean resolveAddrLocally()
resolveAddrLocally(boolean doResolve)
public boolean setAuthenticationMethod(int methodId, Authentication method)
methodId
- Authentication method id, see rfc1928method
- Implementation of AuthenticationAuthentication
public Authentication getAuthenticationMethod(int methodId)
methodId
- Authentication method id.protected void startSession() throws SocksException
startSession
in class Proxy
SocksException
protected ProxyMessage formMessage(int cmd, InetAddress ip, int port)
formMessage
in class Proxy
protected ProxyMessage formMessage(int cmd, String host, int port) throws UnknownHostException
formMessage
in class Proxy
UnknownHostException
protected ProxyMessage formMessage(InputStream in) throws SocksException, IOException
formMessage
in class Proxy
SocksException
IOException
Copyright © 2024. All rights reserved.