try
{
if (log.isDebugEnabled())
log.debug("CONNECT: " + uri);
InetAddrPort addrPort = new InetAddrPort(uri.toString());
if (isForbidden(HttpMessage.__SSL_SCHEME, addrPort.getHost(), addrPort.getPort(), false))
{
sendForbid(request, response, uri);
}
else
{
HttpConnection http_connection=request.getHttpConnection();
http_connection.forceClose();
// Get the timeout
int timeoutMs = 30000;
Object maybesocket = http_connection.getConnection();
if (maybesocket instanceof Socket)
{
Socket s = (Socket) maybesocket;
timeoutMs = s.getSoTimeout();
}
// Create the tunnel
HttpTunnel tunnel = newHttpTunnel(request,response,addrPort.getInetAddress(), addrPort.getPort(),timeoutMs);
if (tunnel!=null)
{
// TODO - need to setup semi-busy loop for IE.