Created
June 12, 2018 19:24
-
-
Save danielchc/ba8ecea87412d1b892965a1081032158 to your computer and use it in GitHub Desktop.
Test proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from urllib import request as urlrequest | |
| proxy_host = 'ip:port' | |
| url = 'http://www.httpbin.org/ip' | |
| #If returns 2 IP means that X-Forwarded isn't disabled | |
| req = urlrequest.Request(url) | |
| req.set_proxy(proxy_host, 'http') | |
| response = urlrequest.urlopen(req) | |
| print(response.read().decode('utf8')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment