com.sshtools.net
Class HttpProxyTransportWrapper

java.lang.Object
  extended by com.sshtools.net.SocketWrapper
      extended by com.sshtools.net.HttpProxyTransportWrapper
All Implemented Interfaces:
SocketTimeoutSupport, SshIO, SshTransport

public class HttpProxyTransportWrapper
extends SocketWrapper

Provides an 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 ""

Author:
Lee David Painter

Field Summary
 
Fields inherited from class com.sshtools.net.SocketWrapper
socket
 
Method Summary
static HttpProxyTransportWrapper connectViaProxy(java.lang.String host, int port, java.lang.String proxyHost, int proxyPort, java.lang.String username, java.lang.String password, java.lang.String userAgent)
          Connect the socket to a HTTP proxy and request forwarding to our remote host.
 SshTransport duplicate()
           
 java.lang.String getHost()
           
 java.lang.String toString()
           
 
Methods inherited from class com.sshtools.net.SocketWrapper
close, getInputStream, getOutputStream, getPort, getSocket, getSoTimeout, setSoTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

connectViaProxy

public static HttpProxyTransportWrapper connectViaProxy(java.lang.String host,
                                                        int port,
                                                        java.lang.String proxyHost,
                                                        int proxyPort,
                                                        java.lang.String username,
                                                        java.lang.String password,
                                                        java.lang.String userAgent)
                                                 throws java.io.IOException,
                                                        java.net.UnknownHostException
Connect the socket to a HTTP proxy and request forwarding to our remote host.

Parameters:
host -
port -
proxyHost -
proxyPort -
username -
password -
userAgent -
Returns:
HttpProxyTransportWrapper
Throws:
java.io.IOException
java.net.UnknownHostException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getHost

public java.lang.String getHost()
Specified by:
getHost in interface SshTransport
Overrides:
getHost in class SocketWrapper

duplicate

public SshTransport duplicate()
                       throws java.io.IOException
Specified by:
duplicate in interface SshTransport
Overrides:
duplicate in class SocketWrapper
Throws:
java.io.IOException


Copyright © 2012. All Rights Reserved.