Skip to content

Commit

Permalink
Fix urllib3 proxy scheme failures (#59) (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBristol authored Oct 16, 2020
1 parent 625ebb6 commit a71fb90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion http_request_randomizer/requests/proxy/requestProxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ def generate_proxied_request(self, url, method="GET", params={}, data={}, header
self.logger.debug("Using headers: {0}".format(str(headers)))
self.logger.debug("Using proxy: {0}".format(str(self.current_proxy)))
request = requests.request(method, url, headers=headers, data=data, params=params, timeout=req_timeout,
proxies={"http": self.current_proxy.get_address(), "https": self.current_proxy.get_address()})
proxies={
"http": "http://{0}".format(self.current_proxy.get_address()),
"https": "https://{0}".format(self.current_proxy.get_address())
})
# Avoid HTTP request errors
if request.status_code == 409:
raise ConnectionError("HTTP Response [409] - Possible Cloudflare DNS resolution error")
Expand Down

0 comments on commit a71fb90

Please sign in to comment.