一部のプロキシ サーバー経由で一部のコンテンツにアクセスしようとしていますが、次のようになります。
<Errno::ETIMEDOUT: Connection timed out - connect(2)>
私はコードを修正し、以下のようにタイムアウトを増やそうとしました:
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
open_timeout
今ではand を認識しませんstart
undefined method `open_timeout=' for #<Net::HTTPOK 200 OK readbody=true>>
undefined method `start..
何か助けはありますか?