-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
squid proxy server says requests.get is "Unsupported Request Method and Protocol" #881
Comments
That's.... bizzare. I hate proxies :) |
501 error? Any idea what the issue is? Has anybody else faced something like this. |
My bad! Solved.
|
@shoibalc I thought I saw an email about you mentioning that 'http_proxy' was the more widely used environment variable... am I hallucinating? |
excellent :) |
Just for future reference, this pops up on PythonAnywhere as well but for HTTPS proxies for which this workaround does not seem to work. |
I still get this with requests 1.2... is there a special patch I need? Here's a post I submitted to request/request#552 I know I've seen lots of stack overflow questions about this. I cannot seem to figure out which version of python and which version of requests are needed to get this simple test working: import requests.packages.urllib3 as urllib3
import unittest
class TestProxyConnect(unittest.TestCase):
def setUp(self):
self.proxy_url='http://192.168.201.138:3128/'
self.https_url='https://www.google.com/index.html'
def test_connect(self):
proxy=urllib3.proxy_from_url(self.proxy_url)
res=proxy.urlopen('GET', self.https_url)
self.assertEqual(res.status, 200)
if __name__ == '__main__':
unittest.main()
It's just trying to use squid. I know this is more urllib3, but I am using the urllib3 that is in the requests 'packages' folder. (venv)[root@cb-server-test urllib3]# pip freeze Can anyone help me figure out how to get HTTPS requests over HTTP to use CONNECT? Thanks, |
HTTPS requests over HTTP currently cannot use CONNECT. For a fuller explanation, see #1359. |
I am behind a squid proxy server (2.7) with authentication. request.get (version 0.14) is rejected by squid.
The text was updated successfully, but these errors were encountered: