|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.net.ServerSocket
socks.SocksServerSocket
public class SocksServerSocket
SocksServerSocket allows to accept connections from one particular host through the SOCKS4 or SOCKS5 proxy.
| Field Summary | |
|---|---|
protected String |
localHost
|
protected InetAddress |
localIP
|
protected int |
localPort
|
protected Proxy |
proxy
|
| Constructor Summary | |
|---|---|
SocksServerSocket(InetAddress ip,
int port)
Creates ServerSocket capable of accepting one connection through the firewall, uses default Proxy. |
|
SocksServerSocket(Proxy p,
InetAddress ip,
int port)
Creates ServerSocket capable of accepting one connection through the firewall, uses given proxy. |
|
SocksServerSocket(Proxy p,
String host,
int port)
Creates ServerSocket capable of accepting one connection through the firewall, uses given proxy. |
|
SocksServerSocket(String host,
int port)
Creates ServerSocket capable of accepting one connection through the firewall, uses default Proxy. |
|
| Method Summary | |
|---|---|
Socket |
accept()
Accepts the incoming connection. |
void |
close()
Closes the connection to proxy if socket have not been accepted, if the direct connection is used, closes direct ServerSocket. |
String |
getHost()
Get the name of the host proxy is using to listen for incoming connection. |
InetAddress |
getInetAddress()
Get address assigned by proxy to listen for incomming connections, or the local machine address if doing direct connection. |
int |
getLocalPort()
Get port assigned by proxy to listen for incoming connections, or the port chosen by local system, if accepting directly. |
void |
setSoTimeout(int timeout)
Set Timeout. |
| Methods inherited from class java.net.ServerSocket |
|---|
bind, bind, getChannel, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Proxy proxy
protected String localHost
protected InetAddress localIP
protected int localPort
| Constructor Detail |
|---|
public SocksServerSocket(String host,
int port)
throws SocksException,
UnknownHostException,
IOException
host - Host from which the connection should be recieved.port - Port number of the primary connection.
SocksException
UnknownHostException
IOException
public SocksServerSocket(Proxy p,
String host,
int port)
throws SocksException,
UnknownHostException,
IOException
p - Proxy object to use.host - Host from which the connection should be recieved.port - Port number of the primary connection.
SocksException
UnknownHostException
IOException
public SocksServerSocket(InetAddress ip,
int port)
throws SocksException,
IOException
ip - Host from which the connection should be recieved.port - Port number of the primary connection.
SocksException
IOException
public SocksServerSocket(Proxy p,
InetAddress ip,
int port)
throws SocksException,
IOException
p - Proxy object to use.ip - Host from which the connection should be recieved.port - Port number of the primary connection.
SocksException
IOException| Method Detail |
|---|
public Socket accept()
throws IOException
accept in class ServerSocketIOException
public void close()
throws IOException
close in class ServerSocketIOExceptionpublic String getHost()
Usefull when address is returned by proxy as the hostname.
public InetAddress getInetAddress()
getInetAddress in class ServerSocketpublic int getLocalPort()
getLocalPort in class ServerSocket
public void setSoTimeout(int timeout)
throws SocketException
setSoTimeout in class ServerSockettimeout - Amount of time in milliseconds, accept should wait for
incoming connection before failing with exception.
Zero timeout implies infinity.
SocketException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||