Class: Mechanize::HTTP::Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/instabot/tor_protocol.rb

Instance Method Summary collapse

Instance Method Details

#set_socks(addr, port) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/instabot/tor_protocol.rb', line 55

def set_socks addr, port
   set_http unless @http
   class << @http
      attr_accessor :socks_addr, :socks_port

      def http_class
        Net::HTTP.SOCKSProxy(socks_addr, socks_port)
      end
   end
   @http.socks_addr = addr
   @http.socks_port = port
end