ymsg.network
Class SOCKSConnectionHandler

Object
  extended byConnectionHandler
      extended byDirectConnectionHandler
          extended bySOCKSConnectionHandler

public class SOCKSConnectionHandler
extends DirectConnectionHandler

Connection handler for SOCKS proxy connections to Yahoo. Pass this class into the Session constructor to create a session which can work through firewalls with SOCKS gateways.

For more information on the Java properties used by this class, read Sun's Java Networking Properties page.

There are two system properties which alter the target of a connection. ymsg.network.directHost can be used to set the host to which the connection will be made. ymsg.network.directPorts can be used to set a comma-separated-list of ports to be tried in order (the first number on this list is treated as the primary port). In reality is it highly unlikely that these properties should need to be changed from their defaults: scs.msg.yahoo.com and 5050,23,25,80.

Since:
1.0

Constructor Summary
SOCKSConnectionHandler()
          Connect using the Java system properties socksProxyHost and socksProxyPort.
SOCKSConnectionHandler(String h, int p)
          Connect using a specific SOCKS proxy host and port.
 
Method Summary
 String toString()
          Returns the string representation of this object.
 
Methods inherited from class DirectConnectionHandler
getHost, getPort
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SOCKSConnectionHandler

public SOCKSConnectionHandler()
Connect using the Java system properties socksProxyHost and socksProxyPort. If these are unset, this constructor will throw an IllegalArgumentException.

Throws:
IllegalStateException - If no HTTP proxy properties set
Since:
1.0

SOCKSConnectionHandler

public SOCKSConnectionHandler(String h,
                              int p)
Connect using a specific SOCKS proxy host and port.

Note: this constructor sets the Java system properties socksProxyHost, socksProxyPort. These settings will be global throughout the JVM.

Parameters:
h - SOCKS host
p - SOCKS port
Since:
1.0
Method Detail

toString

public String toString()
Returns the string representation of this object.

Overrides:
toString in class DirectConnectionHandler
Returns:
object as a string