com.sshtools.net
Class SocksProxyTransport
java.lang.Object
java.net.Socket
com.sshtools.net.SocksProxyTransport
- All Implemented Interfaces:
- SshIO, SshTransport
public class SocksProxyTransport
- extends Socket
- implements SshTransport
Provides an SshTransport implementation that can
route the connection through a SOCKS 4 or SOCKS 5 proxy.
- Author:
- Lee David Painter
|
Method Summary |
static SocksProxyTransport |
connectViaSocks4Proxy(String remoteHost,
int remotePort,
String proxyHost,
int proxyPort,
String userId)
Connect the socket to a SOCKS 4 proxy and request forwarding to our
remote host. |
static SocksProxyTransport |
connectViaSocks5Proxy(String remoteHost,
int remotePort,
String proxyHost,
int proxyPort,
boolean localLookup,
String username,
String password)
Connect the socket to a SOCKS 5 proxy and request forwarding to our
remote host. |
static SocksProxyTransport |
connectViaSocks5Proxy(String remoteHost,
int remotePort,
String proxyHost,
int proxyPort,
String username,
String password)
|
SshTransport |
duplicate()
|
String |
getHost()
|
String |
toString()
|
| Methods inherited from class java.net.Socket |
bind, close, connect, connect, getChannel, getInetAddress, getInputStream, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOutputStream, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput |
SOCKS4
public static final int SOCKS4
- See Also:
- Constant Field Values
SOCKS5
public static final int SOCKS5
- See Also:
- Constant Field Values
connectViaSocks4Proxy
public static SocksProxyTransport connectViaSocks4Proxy(String remoteHost,
int remotePort,
String proxyHost,
int proxyPort,
String userId)
throws IOException,
UnknownHostException
- Connect the socket to a SOCKS 4 proxy and request forwarding to our
remote host.
- Parameters:
remoteHost - remotePort - proxyHost - proxyPort - userId -
- Returns:
- SocksProxyTransport
- Throws:
IOException
UnknownHostException
connectViaSocks5Proxy
public static SocksProxyTransport connectViaSocks5Proxy(String remoteHost,
int remotePort,
String proxyHost,
int proxyPort,
boolean localLookup,
String username,
String password)
throws IOException,
UnknownHostException
- Connect the socket to a SOCKS 5 proxy and request forwarding to our
remote host.
- Parameters:
remoteHost - remotePort - proxyHost - proxyPort - localLookup - username - password -
- Returns:
- SocksProxyTransport
- Throws:
IOException
UnknownHostException
toString
public String toString()
- Overrides:
toString in class Socket
connectViaSocks5Proxy
public static SocksProxyTransport connectViaSocks5Proxy(String remoteHost,
int remotePort,
String proxyHost,
int proxyPort,
String username,
String password)
throws IOException,
UnknownHostException
- Throws:
IOException
UnknownHostException
getHost
public String getHost()
- Specified by:
getHost in interface SshTransport
duplicate
public SshTransport duplicate()
throws IOException
- Specified by:
duplicate in interface SshTransport
- Throws:
IOException
Copyright © 2012. All Rights Reserved.