When I try to attempt the same thing using ruby socksify gem as per the documentation:
require 'socksify/http'
proxy = '<socks_ip>'
port = '<socks_port>'
uri = URI.parse('http://canihazip.com/')
Net::HTTP.SOCKSProxy(proxy, port).start(uri.host, uri.port) do |http|
http.get(uri.path)
end
gives error:
/home/resrev/.rvm/gems/ruby-2.2.2/gems/socksify-1.7.0/lib/socksify.rb:269:in `socks_receive_reply': Server doesn't reply (SOCKSError)
from /home/resrev/.rvm/gems/ruby-2.2.2/gems/socksify-1.7.0/lib/socksify.rb:259:in `socks_connect'
from /home/resrev/.rvm/gems/ruby-2.2.2/gems/socksify-1.7.0/lib/socksify.rb:174:in `initialize'
from /home/resrev/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:879:in `open'
from /home/resrev/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:879:in `block in connect'
from /home/resrev/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
from /home/resrev/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:878:in `connect'
from /home/resrev/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
from /home/resrev/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:852:in `start'
from /home/resrev/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/net/http.rb:583:in `start'
from /home/resrev/pubrevit/lib/tasks/test_rest_client_socks_proxy.rb:51:in `<main>'
I have a socks proxy verified by this command:
curl -x socks5://<socks_ip>:<socks_port> "http://canihazip.com/"
When I try to attempt the same thing using ruby socksify gem as per the documentation:
gives error:
What am I missing?