Class SocksSocketFactory


  • @NotNullByDefault
    public class SocksSocketFactory
    extends javax.net.SocketFactory
    • Constructor Summary

      Constructors 
      Constructor Description
      SocksSocketFactory​(java.net.SocketAddress proxy, int connectToProxyTimeout, int extraConnectTimeout, int extraSocketTimeout)
      Creates a socket factory for a SOCKS proxy that does not require authentication.
      SocksSocketFactory​(java.net.SocketAddress proxy, int connectToProxyTimeout, int extraConnectTimeout, int extraSocketTimeout, java.lang.String username, java.lang.String password)
      Creates a socket factory for a SOCKS proxy that requires username/password authentication.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.Socket createSocket()  
      java.net.Socket createSocket​(java.lang.String host, int port)  
      java.net.Socket createSocket​(java.lang.String host, int port, java.net.InetAddress localHost, int localPort)  
      java.net.Socket createSocket​(java.net.InetAddress host, int port)  
      java.net.Socket createSocket​(java.net.InetAddress address, int port, java.net.InetAddress localAddress, int localPort)  
      • Methods inherited from class javax.net.SocketFactory

        getDefault
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SocksSocketFactory

        public SocksSocketFactory​(java.net.SocketAddress proxy,
                                  int connectToProxyTimeout,
                                  int extraConnectTimeout,
                                  int extraSocketTimeout,
                                  java.lang.String username,
                                  java.lang.String password)
        Creates a socket factory for a SOCKS proxy that requires username/password authentication.
        Parameters:
        connectToProxyTimeout - The timeout in milliseconds for connecting to the proxy.
        extraConnectTimeout - The extra timeout in milliseconds that should be added to the socket's default timeout when connecting to an endpoint via the proxy.
        extraSocketTimeout - The extra timeout in milliseconds that should be added to the socket's default timeout after connecting to an endpoint via the proxy.
      • SocksSocketFactory

        public SocksSocketFactory​(java.net.SocketAddress proxy,
                                  int connectToProxyTimeout,
                                  int extraConnectTimeout,
                                  int extraSocketTimeout)
        Creates a socket factory for a SOCKS proxy that does not require authentication.
        Parameters:
        connectToProxyTimeout - The timeout in milliseconds for connecting to the proxy.
        extraConnectTimeout - The extra timeout in milliseconds that should be added to the socket's default timeout when connecting to an endpoint via the proxy.
        extraSocketTimeout - The extra timeout in milliseconds that should be added to the socket's default timeout after connecting to an endpoint via the proxy.
    • Method Detail

      • createSocket

        public java.net.Socket createSocket()
        Overrides:
        createSocket in class javax.net.SocketFactory
      • createSocket

        public java.net.Socket createSocket​(java.lang.String host,
                                            int port)
                                     throws java.io.IOException
        Specified by:
        createSocket in class javax.net.SocketFactory
        Throws:
        java.io.IOException
      • createSocket

        public java.net.Socket createSocket​(java.net.InetAddress host,
                                            int port)
        Specified by:
        createSocket in class javax.net.SocketFactory
      • createSocket

        public java.net.Socket createSocket​(java.lang.String host,
                                            int port,
                                            java.net.InetAddress localHost,
                                            int localPort)
        Specified by:
        createSocket in class javax.net.SocketFactory
      • createSocket

        public java.net.Socket createSocket​(java.net.InetAddress address,
                                            int port,
                                            java.net.InetAddress localAddress,
                                            int localPort)
        Specified by:
        createSocket in class javax.net.SocketFactory