5

When the code bellow is running

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?

f.rodrigues
  • 3,499
  • 6
  • 26
  • 62
no13bus
  • 347
  • 1
  • 4
  • 15

1 Answers1

3

This link suggests that it is caused at the httplib level.

  1. It may be caused by trying to connect to a https url using http try using https:// and see if it works...
  2. Double check your url doesn't contain any dodgy characters
  3. Check your proxy is accepting headers
Community
  • 1
  • 1
Alexander McFarlane
  • 10,643
  • 9
  • 59
  • 100