Skip to content

Instantly share code, notes, and snippets.

@the-architect
Last active December 24, 2015 22:49
Show Gist options
  • Save the-architect/6875213 to your computer and use it in GitHub Desktop.
Save the-architect/6875213 to your computer and use it in GitHub Desktop.
Fetch a website through Tor
# 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