Package org.briarproject.socks
Class SocksSocketFactory
- java.lang.Object
-
- javax.net.SocketFactory
-
- org.briarproject.socks.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.SocketcreateSocket()java.net.SocketcreateSocket(java.lang.String host, int port)java.net.SocketcreateSocket(java.lang.String host, int port, java.net.InetAddress localHost, int localPort)java.net.SocketcreateSocket(java.net.InetAddress host, int port)java.net.SocketcreateSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddress, int localPort)
-
-
-
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:
createSocketin classjavax.net.SocketFactory
-
createSocket
public java.net.Socket createSocket(java.lang.String host, int port) throws java.io.IOException- Specified by:
createSocketin classjavax.net.SocketFactory- Throws:
java.io.IOException
-
createSocket
public java.net.Socket createSocket(java.net.InetAddress host, int port)- Specified by:
createSocketin classjavax.net.SocketFactory
-
createSocket
public java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress localHost, int localPort)- Specified by:
createSocketin classjavax.net.SocketFactory
-
createSocket
public java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddress, int localPort)- Specified by:
createSocketin classjavax.net.SocketFactory
-
-