net.i2p.socks

## Class SOCKS4Client

- java.lang.Object
- - net.i2p.socks.SOCKS4Client

-     public class SOCKS4Client
      extends Object

  A simple SOCKS 4/4a client. Note: Caller is advised to setSoTimeout on the socket. Not done here.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `connect(InputStream pin, OutputStream pout, String connHostName, int connPort)` Act as a SOCKS 4 client to connect to a proxy Will throw and close pin and pout on all errors.
    `static void` | `connect(Socket sock, String connHostName, int connPort)` Act as a SOCKS 4 client to connect to a proxy Will throw and close sock on all errors.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### connect

          public static void connect(InputStream pin,
                                     OutputStream pout,
                                     String connHostName,
                                     int connPort)
                              throws IOException

      Act as a SOCKS 4 client to connect to a proxy Will throw and close pin and pout on all errors. Caller must close pin and pout on success.
      Parameters:
        `connHostName` - hostname for the proxy to connect to
        `connPort` - port for the proxy to connect to
      Throws:
        `IOException`

    - #### connect

          public static void connect(Socket sock,
                                     String connHostName,
                                     int connPort)
                              throws IOException

      Act as a SOCKS 4 client to connect to a proxy Will throw and close sock on all errors. Caller must close sock on success.
      Parameters:
        `sock` - socket to the proxy
        `connHostName` - hostname for the proxy to connect to
        `connPort` - port for the proxy to connect to
      Throws:
        `IOException`