private DefaultProxyRoutePlanner createProxyRoutePlanner ( HttpSettings settings , HttpAsyncClientBuilder httpClientBuilder ) { HttpHost proxy = new HttpHost ( settings . getProxyUrl ( ) . getHost ( ) , settings . getProxyUrl ( ) . getPort ( ) ) ; if ( settings . getProxyUser ( ) != null ) { CredentialsProvider credentialsProvider = new BasicCredentialsProvider ( ) ; String proxyUser = settings . getProxyUser ( ) ; String proxyPassword = settings . getProxyPassword ( ) ; UsernamePasswordCredentials credentials = new UsernamePasswordCredentials ( proxyUser , proxyPassword ) ; credentialsProvider . setCredentials ( new AuthScope ( proxy ) , credentials ) ; httpClientBuilder . setDefaultCredentialsProvider ( credentialsProvider ) ; } return new DefaultProxyRoutePlanner ( proxy ) ; }
Creates default proxy route planner .