public class HttpProxyTransport extends Socket implements SshTransport
SshTransport
implementation that can route the connection
through a HTTP proxy.
To connect the transport simply call the connectViaProxy(String, int, String, int, String, String, String)
method. You can pass the name of your application as the user agent and if no authentication
is required simply pass ""Modifier and Type | Method and Description |
---|---|
static HttpProxyTransport |
connectViaProxy(String host,
int port,
String proxyHost,
int proxyPort,
String username,
String password,
String userAgent)
Connect the socket to a HTTP proxy and request forwarding to our
remote host.
|
static HttpProxyTransport |
connectViaProxy(String host,
int port,
String proxyHost,
int proxyPort,
String username,
String password,
String userAgent,
Hashtable<String,String> optionalHeaders) |
SshTransport |
duplicate()
Create a new copy of this transport and connect to the
same host:port combination.
|
static int |
getConnectionTimeout() |
String |
getHost()
Get the name of the connected host.
|
static void |
setConnectionTimeout(int connectionTimeout) |
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 void setConnectionTimeout(int connectionTimeout)
public static int getConnectionTimeout()
public static HttpProxyTransport connectViaProxy(String host, int port, String proxyHost, int proxyPort, String username, String password, String userAgent) throws IOException, UnknownHostException
host
- port
- proxyHost
- proxyPort
- username
- password
- userAgent
- IOException
UnknownHostException
public static HttpProxyTransport connectViaProxy(String host, int port, String proxyHost, int proxyPort, String username, String password, String userAgent, Hashtable<String,String> optionalHeaders) throws IOException, UnknownHostException
host
- port
- proxyHost
- proxyPort
- username
- password
- userAgent
- optionalHeaders
- IOException
UnknownHostException
public String getHost()
SshTransport
getHost
in interface SshTransport
public SshTransport duplicate() throws IOException
SshTransport
duplicate
in interface SshTransport
IOException
Copyright © 2024. All rights reserved.