public class SocksProxyTransport extends Socket implements SshTransport
SshTransport
implementation that can
route the connection through a SOCKS 4 or SOCKS 5 proxy.Modifier and Type | Method and Description |
---|---|
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()
Create a new copy of this transport and connect to the same host:port
combination.
|
String |
getHost()
Get the name of the connected host.
|
String |
toString() |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPort
close, getInputStream, getOutputStream
public static final int SOCKS4
public static final int SOCKS5
public static SocksProxyTransport connectViaSocks4Proxy(String remoteHost, int remotePort, String proxyHost, int proxyPort, String userId) throws IOException, UnknownHostException
remoteHost
- remotePort
- proxyHost
- proxyPort
- userId
- IOException
UnknownHostException
public static SocksProxyTransport connectViaSocks5Proxy(String remoteHost, int remotePort, String proxyHost, int proxyPort, boolean localLookup, String username, String password) throws IOException, UnknownHostException
remoteHost
- remotePort
- proxyHost
- proxyPort
- localLookup
- username
- password
- IOException
UnknownHostException
public static SocksProxyTransport connectViaSocks5Proxy(String remoteHost, int remotePort, String proxyHost, int proxyPort, String username, String password) throws IOException, UnknownHostException
IOException
UnknownHostException
public String getHost()
SshTransport
getHost
in interface SshTransport
public SshTransport duplicate() throws IOException
SshTransport
duplicate
in interface SshTransport
IOException
Copyright © 2014. All rights reserved.