Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.