Comment detail

HTTPでGET その2 (Nested Flatten)

Net::HTTP::Proxy を利用する

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require 'net/http'
def get_with_proxy(proxy_server, proxy_port)
    proxy = Net::HTTP::Proxy(proxy_server, proxy_port)
    http = proxy.new('ja.doukaku.org')
    http.open_timeout = 1
    http.start do |h|
      response = h.get('/feeds/comments/')
      puts response.body
    end
end

Index

Feed

Other

Link

Pathtraq

loading...