I am trying to use tor for anonymous access through privoxy as a proxy through urllib2.

System info: Ubuntu 14.04, recently upgraded from 13.10 through dist-upgrade.

This is a piece of code I am using for test purposes:

import urllib2

def req(url):
    proxy_support = urllib2.ProxyHandler({"http": ""})
    opener = urllib2.build_opener(proxy_support)
    opener.addheaders = [('User-agent', 'Mozilla/5.0')]
    return opener.open(url).read()

print req('https://check.torproject.org')

The above outputs a page with a sorry, but you don't use Tor message.

As for my configurations: /etc/tor/torrc

ControlPort 9051
## If you enable the controlport, be sure to enable one of these
## authentication methods, to prevent attackers from accessing it.
#HashedControlPassword 16:872860B76453A77D60CA2BB8C1A7042072093276A3D701AD684053EC4C
HashedControlPassword 16:B3B0BA631D41D6FE601488FC7A9A2E80AB7815580C1C78F2865F30F63B


forward-socks5 / localhost:9050 .

$ sudo netstat -ntap | grep tor outputs:

tcp        0      0*               LISTEN      1045/tor        
tcp        0      0*               LISTEN      1045/tor        
tcp        0      0       ESTABLISHED 1045/tor        
tcp        0      0       ESTABLISHED 1045/tor        
tcp        0      0      ESTABLISHED 1045/tor   

$ sudo netstat -ntap | grep privoxy outputs:

tcp        0      0*               LISTEN      887/privoxy 

And yet, all requests are received at the server with my actual IP


1 Answer 1


You're using as a proxy URL (in a nutshell) with http as your protocol. You should use https instead.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.