You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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()
F
FAIL: test_connect (main.TestProxyConnect)
Traceback (most recent call last):
File "/root/test.py", line 11, in test_connect
self.assertEqual(res.status, 200)
AssertionError: 501 != 200
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
requests==1.2.0
wsgiref==0.1.2
Can anyone help me figure out how to get HTTPS requests over HTTP to use CONNECT?
Thanks,
Ben
The text was updated successfully, but these errors were encountered: