Class SocksProxySocket

java.lang.Object
java.net.Socket
com.enterprisedt.util.proxy.SocksProxySocket
All Implemented Interfaces:
StreamSocket, Closeable, AutoCloseable
Direct Known Subclasses:
Socks4ProxySocket, Socks5ProxySocket

public abstract class SocksProxySocket extends Socket implements StreamSocket
Version:
$Revision$
Author:
$author$
  • 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

      protected InputStream proxyIn
    • proxyOut

      protected OutputStream proxyOut
    • providerDetail

      protected String providerDetail
    • proxyHost

      protected String proxyHost
    • proxyPort

      protected int proxyPort
    • username

      protected String username
    • password

      protected String password
    • bindingAddress

      protected String bindingAddress
    • bindingPort

      protected int bindingPort
    • remoteHostname

      protected String remoteHostname
  • Constructor Details

    • SocksProxySocket

      public SocksProxySocket()
  • Method Details

    • isSecureMode

      public boolean isSecureMode()
      Is this socket in secure mode?
      Specified by:
      isSecureMode in interface StreamSocket
      Returns:
      true if secure mode
    • getRemoteHost

      public String getRemoteHost()
      Get the actual hostname
      Specified by:
      getRemoteHost in interface StreamSocket
      Returns:
      remote hostname
    • setRemoteHost

      public void setRemoteHost(String remoteHost)
      Set the remote hostname
      Specified by:
      setRemoteHost in interface StreamSocket
      Parameters:
      remoteHost - remote hostname
    • getProxyHost

      public String getProxyHost()
    • setProxyHost

      public void setProxyHost(String proxyHost)
    • getProxyPort

      public int getProxyPort()
    • setProxyPort

      public void setProxyPort(int proxyPort)
    • getBindingAddress

      public String getBindingAddress()
    • getBindingPort

      public int getBindingPort()
    • getUsername

      public String getUsername()
    • setUsername

      public void setUsername(String username)
    • getPassword

      public String getPassword()
    • setPassword

      public void setPassword(String password)
    • getDetail

      public String getDetail()
      Description copied from interface: StreamSocket
      Get details about the socket
      Specified by:
      getDetail in interface StreamSocket
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Socket
    • connect

      public void connect(SocketAddress endpoint, int timeout) throws IOException
      Overrides:
      connect in class Socket
      Throws:
      IOException
    • bind

      public void bind(String remoteHost) throws IOException
      Throws:
      IOException
    • accept

      public void accept() throws IOException
      Throws:
      IOException
    • sendRequest

      protected abstract void sendRequest(int command, String remoteHost, int remotePort) throws IOException
      Throws:
      IOException
    • readResponse

      protected abstract void readResponse() throws IOException
      Throws:
      IOException