java.net
Class SocksSocketImplFactory
java.lang.Object
java.net.SocksSocketImplFactory
- All Implemented Interfaces:
- SocketImplFactory, SocksConsts
- class SocksSocketImplFactory
- extends Object
- implements SocketImplFactory, SocksConsts
This factory creates an SocketImpl that implements the SOCKS protocol
(both V5 & V4). It implements RFC 1928.
- See Also:
Socket.setSocketImplFactory(SocketImplFactory)
,
java.net.ServerSocket#setSocketImplFactory(SocketImplFactory)
Constructor Summary |
(package private) |
SocksSocketImplFactory(String server,
int port)
Creates a SocksSocketImplFactory with a specific server & port.
|
(package private) |
SocksSocketImplFactory(String server,
int port,
boolean v4)
Creates a SocksSocketImplFactory with a specific server & port. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
server
private String server
port
private int port
useV4
private boolean useV4
PROTO_VERS4
public static final int PROTO_VERS4
- See Also:
- Constant Field Values
PROTO_VERS
public static final int PROTO_VERS
- See Also:
- Constant Field Values
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
NO_AUTH
public static final int NO_AUTH
- See Also:
- Constant Field Values
GSSAPI
public static final int GSSAPI
- See Also:
- Constant Field Values
USER_PASSW
public static final int USER_PASSW
- See Also:
- Constant Field Values
NO_METHODS
public static final int NO_METHODS
- See Also:
- Constant Field Values
CONNECT
public static final int CONNECT
- See Also:
- Constant Field Values
BIND
public static final int BIND
- See Also:
- Constant Field Values
UDP_ASSOC
public static final int UDP_ASSOC
- See Also:
- Constant Field Values
IPV4
public static final int IPV4
- See Also:
- Constant Field Values
DOMAIN_NAME
public static final int DOMAIN_NAME
- See Also:
- Constant Field Values
IPV6
public static final int IPV6
- See Also:
- Constant Field Values
REQUEST_OK
public static final int REQUEST_OK
- See Also:
- Constant Field Values
GENERAL_FAILURE
public static final int GENERAL_FAILURE
- See Also:
- Constant Field Values
NOT_ALLOWED
public static final int NOT_ALLOWED
- See Also:
- Constant Field Values
NET_UNREACHABLE
public static final int NET_UNREACHABLE
- See Also:
- Constant Field Values
HOST_UNREACHABLE
public static final int HOST_UNREACHABLE
- See Also:
- Constant Field Values
CONN_REFUSED
public static final int CONN_REFUSED
- See Also:
- Constant Field Values
TTL_EXPIRED
public static final int TTL_EXPIRED
- See Also:
- Constant Field Values
CMD_NOT_SUPPORTED
public static final int CMD_NOT_SUPPORTED
- See Also:
- Constant Field Values
ADDR_TYPE_NOT_SUP
public static final int ADDR_TYPE_NOT_SUP
- See Also:
- Constant Field Values
SocksSocketImplFactory
SocksSocketImplFactory(String server,
int port)
- Creates a SocksSocketImplFactory with a specific server & port.
This should point to a SOCKS v5 proxy server.
- Parameters:
server
- the server hostnameport
- the port number. -1 for the default SOCKS port.
SocksSocketImplFactory
SocksSocketImplFactory(String server,
int port,
boolean v4)
- Creates a SocksSocketImplFactory with a specific server & port.
- Parameters:
server
- the server hostnameport
- the port number. -1 for the default SOCKS port.v4
- true
if the protocol should be version 4
false
for version 5.
checkProps
private void checkProps()
guessVersion
private void guessVersion()
createSocketImpl
public SocketImpl createSocketImpl()
- Creates a new
SocketImpl
instance.
- Specified by:
createSocketImpl
in interface SocketImplFactory
- Returns:
- a new instance of
SocketImpl
. - See Also:
SocketImpl