I don't know how to download data from URL using open-uri and active proxy.
I used this code:
proxy = Net::HTTP::Proxy("??????????????????????")
proxy.start('http://www.example.com') { |http|
puts open(strURL).read
}
but Ruby returned error: c:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in `initialize': A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. - connect(2) (Errno::ETIMEDOUT)
What's wrong ?( I don't want to use HTTP)(
Try this :
require 'open-uri'
p = open('http://www.example.com',
proxy: URI.parse("http://190.72.158.80:8080")
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With