Skip to content

Commit a71fb90

Browse files
authored
Fix urllib3 proxy scheme failures (#59) (#60)
1 parent 625ebb6 commit a71fb90

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

http_request_randomizer/requests/proxy/requestProxy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ def generate_proxied_request(self, url, method="GET", params={}, data={}, header
111111
self.logger.debug("Using headers: {0}".format(str(headers)))
112112
self.logger.debug("Using proxy: {0}".format(str(self.current_proxy)))
113113
request = requests.request(method, url, headers=headers, data=data, params=params, timeout=req_timeout,
114-
proxies={"http": self.current_proxy.get_address(), "https": self.current_proxy.get_address()})
114+
proxies={
115+
"http": "http://{0}".format(self.current_proxy.get_address()),
116+
"https": "https://{0}".format(self.current_proxy.get_address())
117+
})
115118
# Avoid HTTP request errors
116119
if request.status_code == 409:
117120
raise ConnectionError("HTTP Response [409] - Possible Cloudflare DNS resolution error")

0 commit comments

Comments
 (0)