java.lang.Object
net.i2p.socks.SOCKS4Client
A simple SOCKS 4/4a client. Note: Caller is advised to setSoTimeout on the socket. Not done here.
Method Summary
All MethodsModifier and TypeMethodDescriptionstatic voidconnect(InputStream pin, OutputStream pout, String connHostName, int connPort) Act as a SOCKS 4 client to connect to a proxystatic voidAct as a SOCKS 4 client to connect to a proxy
Method Details
connect
Act as a SOCKS 4 client to connect to a proxyWill throw and close sock on all errors. Caller must close sock on success.
- Parameters:
sock- socket to the proxyconnHostName- hostname for the proxy to connect toconnPort- port for the proxy to connect to- Throws:
IOException- if the proxy rejects the request or the exchange fails; the socket is closed first
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 proxyWill throw and close pin and pout on all errors. Caller must close pin and pout on success.
- Parameters:
pin- input stream from the proxypout- output stream to the proxyconnHostName- hostname for the proxy to connect toconnPort- port for the proxy to connect to- Throws:
IOException- if the connection fails or the proxy rejects the request