Last active
December 24, 2015 22:49
-
-
Save the-architect/6875213 to your computer and use it in GitHub Desktop.
Fetch a website through Tor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# brew install tor / apt-get install tor | |
# follow the instructions to start the tor server | |
# gem install socksify | |
require 'socksify/http' | |
uri = URI.parse('http://rubyforge.org/') | |
# 9050 is the tor port | |
Net::HTTP.SOCKSProxy('127.0.0.1', 9050).start(uri.host, uri.port) do |http| | |
http.get(uri.path) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment