Forum: Ruby ruby proxy http headers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1fd27153517af6152950e13e5ee1b27e?d=identicon&s=25 Sarek Mather (mushini)
on 2012-12-23 01:23
How do I add headers to a proxy request using Net/Http?

proxy = Net::HTTP::Proxy(proxy_host, proxy_port)
proxy.start(url) { |http|
      res = http.get('/').body
      }



compared to:
req = Net::HTTP::Post.new(uri.request_uri)
req['Host']=$host
res = Net::HTTP.start(uri.hostname, uri.port) {|http|
      http.request(req)
      }
This topic is locked and can not be replied to.