Monthly Archives: July 2013

Configure Tor to use a node in a specific country

Create a configuration file, say “torrc”

(Default configuration file and a sample file location in Mac OS X Lion: /usr/local/etc/tor/)

Include the following lines in the configuration file:

ExitNodes {TR}
StrictExitNodes 1

Run Tor from the Terminal:

tor -f /Users/admin/Documents/Python/MyProject/torrc

To test it with Python:

from selenium import webdriver
import socket
profile.set_preference('network.proxy.type', 1)
profile.set_preference('network.proxy.socks', '')
profile.set_preference('network.proxy.socks_port', 9050)

Useful link for checking Tor status, Tor servers with country information, etc:

See also: