This question already has an answer here:

I am trying to see the concept of tor and prvoxy

import socks
import socket
def create_connection(address, timeout=None, source_address=None):
    sock = socks.socksocket()
    return sock

socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "", 9050)

# patch the socket module
socket.socket = socks.socksocket
socket.create_connection = create_connection

import urllib2
res = urllib2.urlopen("https://www.google.com")

I started tor and privoxy, now want to see that in last line, request to google going from which IP. how to look at this?

marked as duplicate by Michael Hampton Jun 9 '15 at 14:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


The easiest way to check the public IP address would be to first make a HTTP request to a service like:


The same address would be seen by Google server if you make another HTTP request.

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