public final void tunnelProxy(HttpHost proxy,boolean secure){
  if (proxy == null) {
    throw new IllegalArgumentException("Proxy host may not be null.");
  }
  if (!this.connected) {
    throw new IllegalStateException("No tunnel unless connected.");
  }
  if (this.proxyChain == null) {
    throw new IllegalStateException("No proxy tunnel without proxy.");
  }
  HttpHost[] proxies=new HttpHost[this.proxyChain.length + 1];
  System.arraycopy(this.proxyChain,0,proxies,0,this.proxyChain.length);
  proxies[proxies.length - 1]=proxy;
  this.proxyChain=proxies;
  this.secure=secure;
}

public final void tunnelProxy ( HttpHost proxy , boolean secure ) { if ( proxy == null ) { throw new IllegalArgumentException ( "Proxy host may not be null." ) ; } if ( ! this . connected ) { throw new IllegalStateException ( "No tunnel unless connected." ) ; } if ( this . proxyChain == null ) { throw new IllegalStateException ( "No proxy tunnel without proxy." ) ; } HttpHost [ ] proxies = new HttpHost [ this . proxyChain . length + 1 ] ; System . arraycopy ( this . proxyChain , 0 , proxies , 0 , this . proxyChain . length ) ; proxies [ proxies . length - 1 ] = proxy ; this . proxyChain = proxies ; this . secure = secure ; }
tracks tunnelling to a proxy in a proxy chain . this will extend the tracked proxy chain , but it does not mark the route as tunnelled . only end - to - end tunnels are considered there .
