Connect to Tor network with ruby

前端 未结 4 1315
故里飘歌
故里飘歌 2021-02-05 12:03

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

4条回答
  •  广开言路
    2021-02-05 12:31

    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.

提交回复
热议问题