com.valhalla.jbother
Class ProxySocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by com.valhalla.jbother.ProxySocketFactory

public class ProxySocketFactory
extends javax.net.SocketFactory

Allows connections to SOCKS4 and SOCKS5 proxy servers. This is not a generic implementation of either protocol, it was developed specifically for JBother and supports only a subset of features of the proxy protocols.

Author:
Mike Radin - mike@projecttree.com

Field Summary
static int SOCKS4
           
static int SOCKS5
           
static int SOCKS5PASSWD
           
 
Constructor Summary
ProxySocketFactory(java.lang.String host, int port)
           
ProxySocketFactory(java.lang.String host, int port, int type, java.lang.String user, java.lang.String passwd)
           
 
Method Summary
 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)
           
 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)
           
 
Methods inherited from class javax.net.SocketFactory
createSocket, getDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOCKS4

public static final int SOCKS4
See Also:
Constant Field Values

SOCKS5

public static final int SOCKS5
See Also:
Constant Field Values

SOCKS5PASSWD

public static final int SOCKS5PASSWD
See Also:
Constant Field Values
Constructor Detail

ProxySocketFactory

public ProxySocketFactory(java.lang.String host,
                          int port)

ProxySocketFactory

public ProxySocketFactory(java.lang.String host,
                          int port,
                          int type,
                          java.lang.String user,
                          java.lang.String passwd)
Method Detail

createSocket

public java.net.Socket createSocket(java.net.InetAddress 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 address,
                                    int port,
                                    java.net.InetAddress localAddress,
                                    int localPort)
                             throws java.io.IOException
Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException

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.lang.String host,
                                    int port,
                                    java.net.InetAddress localHost,
                                    int localPort)
                             throws java.io.IOException
Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException