-
-
Save stratoukos/7545c5c909fa9b5d1cfb to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
""" | |
You need a way to verify whether the proxy is used. An easy one is to install | |
squid and block all other outgoing connections with something like: | |
iptables -A OUTPUT -m owner --uid-owner root -j ACCEPT | |
iptables -A OUTPUT -m owner --uid-owner proxy -j ACCEPT | |
iptables -A OUTPUT -p tcp --dport 80 -j DROP | |
iptables -A OUTPUT -p tcp --dport 443 -j DROP | |
""" | |
import urllib3 | |
proxy = urllib3.ProxyManager('http://localhost:3128/') | |
count = 0 | |
while True: | |
r = proxy.request('GET', 'https://pypi.python.org/') | |
print count | |
count += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment