org.mortbay.http
Class HttpTunnel

java.lang.Object
  |
  +--org.mortbay.http.HttpTunnel

public class HttpTunnel
extends java.lang.Object

HTTP Tunnel. A HTTP Tunnel can be used to take over a HTTP connection in order to tunnel another protocol over it. The prime example is the CONNECT method handled by the ProxyHandler to setup a SSL tunnel between the client and the real server.

Version:
$Revision: 1.2.2.3 $
Author:
Greg Wilkins (gregw)
See Also:
HttpConnection

Constructor Summary
HttpTunnel(java.net.Socket socket)
          Deprecated. Use version with timeout
HttpTunnel(java.net.Socket socket, int timeoutMs)
          Constructor.
 
Method Summary
 void handle(java.io.InputStream in, java.io.OutputStream out)
          handle method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpTunnel

public HttpTunnel(java.net.Socket socket)
Deprecated. Use version with timeout

Constructor.

Parameters:
socket - The tunnel socket.

HttpTunnel

public HttpTunnel(java.net.Socket socket,
                  int timeoutMs)
           throws java.net.SocketException
Constructor.

Parameters:
socket - The tunnel socket.
timeoutMs - The maximum time to wait for a read on the tunnel. Note that sotimer exceptions are ignored by the tunnel as they may be set to a short period for IE bug.
Method Detail

handle

public void handle(java.io.InputStream in,
                   java.io.OutputStream out)
handle method. This method is called by the HttpConnection.handleNext() method if this HttpTunnel has been set on that connection. The default implementation of this method copies between the HTTP socket and the socket passed in the constructor.

Parameters:
in -
out -


Copyright ? 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.