@Anurag
Thank you for your answer. I really didnt expect you to post a reply.
What you are suggesting is definitely the standard way to use a proxy in 
net::http with the proxy configuration being retrieved from the 
environment variables

But as you see, in your code :

proxy_class.start('www.example.com') do |http|
    # whatever
end

I do not always have the url to which the request is being POSTed. In 
fact the request is already being made by the third party code using 
something like :

    res = Net::HTTP.start(url.host, url.port) {|http|
      # whatever
    }

So what I really meant was that if I could force this request to follow 
the proxy configurations without changing the code.

-- 
Posted via http://www.ruby-forum.com/.