Package com.enterprisedt.util.proxy
Class SocksProxySocket
java.lang.Object
java.net.Socket
com.enterprisedt.util.proxy.SocksProxySocket
- All Implemented Interfaces:
StreamSocket,Closeable,AutoCloseable
- Direct Known Subclasses:
Socks4ProxySocket,Socks5ProxySocket
- Version:
- $Revision$
- Author:
- $author$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected Stringprotected intprotected static final intprotected static final intprotected Stringprotected Stringprotected Stringprotected InputStreamprotected OutputStreamprotected intprotected Stringprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept()voidvoidconnect(SocketAddress endpoint, int timeout) intGet details about the socketintGet the actual hostnamebooleanIs this socket in secure mode?protected abstract voidprotected abstract voidsendRequest(int command, String remoteHost, int remotePort) voidsetPassword(String password) voidsetProxyHost(String proxyHost) voidsetProxyPort(int proxyPort) voidsetRemoteHost(String remoteHost) Set the remote hostnamevoidsetUsername(String username) toString()Methods inherited from class java.net.Socket
bind, close, connect, getChannel, getInetAddress, getInputStream, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOption, getOutputStream, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, supportedOptionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.enterprisedt.util.proxy.StreamSocket
close, getInetAddress, getInputStream, getLocalAddress, getLocalPort, getOutputStream, getReceiveBufferSize, getSendBufferSize, getSoTimeout, isConnected, setReceiveBufferSize, setSendBufferSize, setSoTimeout
-
Field Details
-
CONNECT
protected static final int CONNECT- See Also:
-
BIND
protected static final int BIND- See Also:
-
NULL_TERMINATION
protected static final int NULL_TERMINATION- See Also:
-
proxyIn
-
proxyOut
-
providerDetail
-
proxyHost
-
proxyPort
protected int proxyPort -
username
-
password
-
bindingAddress
-
bindingPort
protected int bindingPort -
remoteHostname
-
-
Constructor Details
-
SocksProxySocket
public SocksProxySocket()
-
-
Method Details
-
isSecureMode
public boolean isSecureMode()Is this socket in secure mode?- Specified by:
isSecureModein interfaceStreamSocket- Returns:
- true if secure mode
-
getRemoteHost
Get the actual hostname- Specified by:
getRemoteHostin interfaceStreamSocket- Returns:
- remote hostname
-
setRemoteHost
Set the remote hostname- Specified by:
setRemoteHostin interfaceStreamSocket- Parameters:
remoteHost- remote hostname
-
getProxyHost
-
setProxyHost
-
getProxyPort
public int getProxyPort() -
setProxyPort
public void setProxyPort(int proxyPort) -
getBindingAddress
-
getBindingPort
public int getBindingPort() -
getUsername
-
setUsername
-
getPassword
-
setPassword
-
getDetail
Description copied from interface:StreamSocketGet details about the socket- Specified by:
getDetailin interfaceStreamSocket- Returns:
-
toString
-
connect
- Overrides:
connectin classSocket- Throws:
IOException
-
bind
- Throws:
IOException
-
accept
- Throws:
IOException
-
sendRequest
protected abstract void sendRequest(int command, String remoteHost, int remotePort) throws IOException - Throws:
IOException
-
readResponse
- Throws:
IOException
-