|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--socks.Proxy
Abstract class Proxy, base for classes Socks4Proxy and Socks5Proxy. Defines methods for specifying default proxy, to be used by all classes of this package.
| Field Summary | |
static int |
SOCKS_ADDR_NOT_SUPPORTED
|
static int |
SOCKS_AUTH_FAILURE
|
static int |
SOCKS_AUTH_NOT_SUPPORTED
|
static int |
SOCKS_BADCONNECT
|
static int |
SOCKS_BADNETWORK
|
static int |
SOCKS_CMD_NOT_SUPPORTED
|
static int |
SOCKS_CONNECTION_REFUSED
|
static int |
SOCKS_DIRECT_FAILED
|
static int |
SOCKS_FAILURE
|
static int |
SOCKS_HOST_UNREACHABLE
|
static int |
SOCKS_JUST_ERROR
|
static int |
SOCKS_METHOD_NOTSUPPORTED
|
static int |
SOCKS_NO_PROXY
|
static int |
SOCKS_PROXY_IO_ERROR
|
static int |
SOCKS_PROXY_NO_CONNECT
|
static int |
SOCKS_SUCCESS
|
static int |
SOCKS_TTL_EXPIRE
|
| Method Summary | |
void |
addDirect(java.net.InetAddress ip)
Adds given ip to the list of direct addresses. |
void |
addDirect(java.net.InetAddress from,
java.net.InetAddress to)
Adds given range of addresses to the lsit of direct addresses, machines within this range will be accessed without using proxy. |
boolean |
addDirect(java.lang.String host)
Adds host to the list of direct addresses. |
Proxy |
getChainProxy()
Get proxy which is used to connect to this proxy. |
static Proxy |
getDefaultProxy()
Get current default proxy. |
InetRange |
getDirect()
Get the list of direct hosts. |
java.net.InetAddress |
getInetAddress()
Get the ip address of the proxy server host. |
int |
getPort()
Get the port on which proxy server is running. |
boolean |
isDirect(java.net.InetAddress host)
Check wether the given host is on the list of direct addresses. |
boolean |
isDirect(java.lang.String host)
Check wether the given host is on the list of direct address. |
static Proxy |
parseProxy(java.lang.String proxy_entry)
Parses strings in the form: host[:port:user:password], and creates proxy from information obtained from parsing. |
void |
setChainProxy(Proxy chainProxy)
Set the proxy which should be used to connect to given proxy. |
static void |
setDefaultProxy(java.net.InetAddress ipAddress,
int port)
Sets SOCKS5 proxy as default. |
static void |
setDefaultProxy(java.net.InetAddress ipAddress,
int port,
java.lang.String user)
Sets SOCKS4 proxy as default. |
static void |
setDefaultProxy(Proxy p)
Sets default proxy. |
static void |
setDefaultProxy(java.lang.String hostName,
int port)
Sets SOCKS5 proxy as default. |
static void |
setDefaultProxy(java.lang.String hostName,
int port,
java.lang.String user)
Sets SOCKS4 proxy as default. |
void |
setDirect(InetRange ir)
Sets given InetRange as the list of direct address, previous list will be discarded, any changes done previously with addDirect(Inetaddress) will be lost. |
java.lang.String |
toString()
Get string representation of this proxy. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int SOCKS_SUCCESS
public static final int SOCKS_FAILURE
public static final int SOCKS_BADCONNECT
public static final int SOCKS_BADNETWORK
public static final int SOCKS_HOST_UNREACHABLE
public static final int SOCKS_CONNECTION_REFUSED
public static final int SOCKS_TTL_EXPIRE
public static final int SOCKS_CMD_NOT_SUPPORTED
public static final int SOCKS_ADDR_NOT_SUPPORTED
public static final int SOCKS_NO_PROXY
public static final int SOCKS_PROXY_NO_CONNECT
public static final int SOCKS_PROXY_IO_ERROR
public static final int SOCKS_AUTH_NOT_SUPPORTED
public static final int SOCKS_AUTH_FAILURE
public static final int SOCKS_JUST_ERROR
public static final int SOCKS_DIRECT_FAILED
public static final int SOCKS_METHOD_NOTSUPPORTED
| Method Detail |
public int getPort()
public java.net.InetAddress getInetAddress()
public void addDirect(java.net.InetAddress ip)
public boolean addDirect(java.lang.String host)
public void addDirect(java.net.InetAddress from,
java.net.InetAddress to)
public void setDirect(InetRange ir)
ir - InetRange which should be used to look up direct addresses.InetRangepublic InetRange getDirect()
InetRangepublic boolean isDirect(java.lang.String host)
host - Host name to check.public boolean isDirect(java.net.InetAddress host)
host - Host address to check.public void setChainProxy(Proxy chainProxy)
chainProxy - Proxy to use to connect to this proxy.public Proxy getChainProxy()
public java.lang.String toString()
public static void setDefaultProxy(java.lang.String hostName,
int port,
java.lang.String user)
throws java.net.UnknownHostException
hostName - Host name on which SOCKS4 server is running.port - Port on which SOCKS4 server is running.user - Username to use for communications with proxy.
public static void setDefaultProxy(java.net.InetAddress ipAddress,
int port,
java.lang.String user)
ipAddress - Host address on which SOCKS4 server is running.port - Port on which SOCKS4 server is running.user - Username to use for communications with proxy.
public static void setDefaultProxy(java.lang.String hostName,
int port)
throws java.net.UnknownHostException
hostName - Host name on which SOCKS5 server is running.port - Port on which SOCKS5 server is running.
public static void setDefaultProxy(java.net.InetAddress ipAddress,
int port)
ipAddress - Host address on which SOCKS5 server is running.port - Port on which SOCKS5 server is running.public static void setDefaultProxy(Proxy p)
p - Proxy to use as default proxy.public static Proxy getDefaultProxy()
public static Proxy parseProxy(java.lang.String proxy_entry)
Defaults: port = 1080.
If user specified but not password, creates Socks4Proxy, if user
not specified creates Socks5Proxy, if both user and password are
speciefied creates Socks5Proxy with user/password authentication.
proxy_entry - String in the form host[:port:user:password]
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||