Skip to content

Instantly share code, notes, and snippets.

@iammehrabalam
Created October 29, 2016 16:32
Show Gist options
  • Save iammehrabalam/f0bd251b653f0b80c0e162ee5f9d1ec5 to your computer and use it in GitHub Desktop.
Save iammehrabalam/f0bd251b653f0b80c0e162ee5f9d1ec5 to your computer and use it in GitHub Desktop.
sudo apt-get install tor
# check tor service running on port 9050 (ss -aln | grep 9050)
# change ip after every 10 sec
edit vi /etc/tor/torrc and add MaxCircuitDirtiness 10
# use tor proxy in python request
install requests==2.10.0 (pip install requests==2.10.0) (currently 2.11 giving error)
install pysocks (pip install pysocks)
import requests
proxy={'http': 'socks5://localhost:9050'}
print requests.get('http://icanhazip.com', proxies=proxy).text
###############
##export all_proxy=socks://127.0.0.1:9050
##export ALL_PROXY=http://127.0.0.1:9050
##export http_proxy=socks://127.0.0.1:9050
@pilgrim2go
Copy link

Thanks
We can use privoxy as stated https://gist.github.com/ifnull/9026823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment