"Connection is interrupted" and "Cannot connect to proxy"

When the code below works

import requests monitor_r = requests.get(monitor_url, proxies=proxies, timeout=60*4) 

I get these exceptions:

 ('Connection aborted.', BadStatusLine("''",)) # and ('Cannot connect to proxy.', error(32, 'Broken pipe'))) 

What are these errors and how to fix them?

+5
source share
1 answer

This link indicates that it is called at the httplib level.

  • This may be caused by trying to connect to the https url using http try using https:// and see if it works ...
  • Double-checking your URL does not contain dodgy characters
  • Verify that your proxy accepts headers.
+3
source

Source: https://habr.com/ru/post/1204480/


All Articles