Tutorial :Connect to Tor network with ruby



Question:

how can I configure Ruby web client to request web pages using Tor ?


Solution:1

I think it's like specifying proxy server for your HTTP connection. I don't know how it works in Ruby. But it will not be different from configuring browsers. Just set proxy server setting to 127.0.0.1:8118.


Solution:2

I had to use this Gem http://socksify.rubyforge.org/ then I was able to do something like this

TCPSocket::socks_server = "127.0.0.1"  TCPSocket::socks_port = 9050  reply = Net::HTTP.get URI.parse("www.google.com")  

Obviously with the Tor proxy running.


Solution:3

Created a Gem, maybe can help others: https://github.com/brunogh/tor_requests


Solution:4

You just need to work with the Proxy class. As Ivan says above, get Tor running then point Net::HTTP.Proxy at the correct localhost address and you're golden.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »