6

I'm using pycURL to make a few requests to a https site through a http proxy.

Here's my code:

import pycurl
buf = cStringIO.StringIO()
c = pycurl.Curl()
c.setopt(c.URL, url) # 'url' is the base url of the form https://www.target.com
c.setopt(c.PROXY, proxy) # 'proxy' has the form 1.2.3.4:8080
c.setopt(c.WRITEFUNCTION, buf.write)
c.perform()  

I've tried this code with different proxies. I get either Proxy CONNECT aborted or Received HTTP code 400 from proxy after CONNECT.

Is there something I'm missing? Should I be using https proxies instead? I've looked around and can't seem to find any help or documentation on pycURL's usage.

Any help appreciated. Thanks!

cs95
  • 379,657
  • 97
  • 704
  • 746
  • sudo apt-get -qy install wireshark, you'll be able to see what wrong with the HTTP, perhaps curl -L also. interesting bug btw, I can't see to figure it out – Abdul Ahad Jan 17 '18 at 16:38

1 Answers1

0

I have a problem similar to yours, and my error log is: fatal: unable to access 'https://github.com/nhn/raphael.git/': Received HTTP code 400 from proxy after CONNECT so i use these commond to resolve my problem, first view your git profile

git config --global --edit then to delete config [remote "origin"] proxy = https://github.com/facette/facette.git

jun ye
  • 11
  • 2