Apache HttpClient 4.1 – Proxy Authentication

For anyone looking for the answer for 4.3…its fairly new and their example didn’t use the new HttpClientBuilder…so this is how I implemented this in that version: NTCredentials ntCreds = new NTCredentials(ntUsername, ntPassword,localMachineName, domainName ); CredentialsProvider credsProvider = new BasicCredentialsProvider(); credsProvider.setCredentials( new AuthScope(proxyHost,proxyPort), ntCreds ); HttpClientBuilder clientBuilder = HttpClientBuilder.create(); clientBuilder.useSystemProperties(); clientBuilder.setProxy(new HttpHost(pxInfo.getProxyURL(), pxInfo.getProxyPort())); clientBuilder.setDefaultCredentialsProvider(credsProvider); clientBuilder.setProxyAuthenticationStrategy(new … Read more

How to set proxy authentication (user & password) using Python + Selenium

Dup of: How to set proxy AUTHENTICATION username:password using Python/Selenium Selenium-wire: https://github.com/wkeeling/selenium-wire Install selenium-wire pip install selenium-wire Import it from seleniumwire import webdriver Auth to proxy options = { ‘proxy’: { ‘http’: ‘http://username:password@host:port’, ‘https’: ‘https://username:password@host:port’, ‘no_proxy’: ‘localhost,127.0.0.1,dev_server:8080’ } } driver = webdriver.Firefox(seleniumwire_options=options) Warning Take a look to the selenium-wire cache folder. I had a problem … Read more