@ Deprecated public ProxySelector getOriginalProxySelector ( ) { return new ProxySelector ( ) { @ Override public List < Proxy > select ( URI uri ) { InetSocketAddress address = originalProxies . get ( uri . getScheme ( ) ) ; if ( address != null && ! ( originalNonProxyHosts . contains ( uri . getHost ( ) ) ) ) { return Collections . singletonList ( new Proxy ( HTTP , address ) ) ; } else { return Collections . singletonList ( Proxy . NO_PROXY ) ; } } @ Override public void connectFailed ( URI uri , SocketAddress sa , IOException ioe ) { } } ; }
Used by the Betamax proxy so that it can use pre - existing proxy settings when forwarding requests that do not match anything on tape .