question: private void sendCONNECTRequest ( ) throws IOException { int port = url . getPort ( ) ; requests . set ( 0 , HTTP_CONNECT + " " + connectRequestURI ( url ) + " " + httpVersion , null ) ; requests . setIfNotSet ( "User-Agent" , userAgent ) ; String host = url . getHost ( ) ; if ( port != - 1 && port != url . getDefaultPort ( ) ) { host += ":" + String . valueOf ( port ) ; } requests . setIfNotSet ( "Host" , host ) ; requests . setIfNotSet ( "Accept" , acceptString ) ; if ( http . getHttpKeepAliveSet ( ) ) { requests . setIfNotSet ( "Proxy-Connection" , "keep-alive" ) ; } setPreemptiveProxyAuthentication ( requests ) ; if ( logger . isLoggable ( PlatformLogger . Level . FINE ) ) { logger . fine ( requests . toString ( ) ) ; } http . writeRequests ( requests , null ) ; }
target:  send a CONNECT request for establishing a tunnel to proxy server