I'm trying to access some contents via some proxy servers but I get:
<Errno::ETIMEDOUT: Connection timed out - connect(2)>
I modified the code and tried to increase the timeout as below:
require 'open-uri'
require 'net/http'
response = Net::HTTP::Proxy(proxy_ip, proxy_port).get_response(uri.host, uri.path)
response.start(uri.host) do |http|
http.open_timeout = 5
http.read_timeout = 10
end
Now it doesn't recagnize the open_timeout
and start
undefined method `open_timeout=' for #<Net::HTTPOK 200 OK readbody=true>>
undefined method `start..
Any help?