简体   繁体   中英

forcing all http requests to follow system proxy configuration

I am working with a ruby application that uses some loosely coupled modules that interface with a web service. These modules use net::http module of ruby for network communication. But the original code has no means to specify proxy configurations. And of course ruby's net::http does not respect system proxy configuration.

I would like to know if there is a way to channelize all the http requests through the proxy server specified by path variable 'http_proxy' without changing these modules. (These modules are separately maintained and making hard changes would make things difficult while updating them in future)

Any help would be appreciated.

I had exactly this problem and it seems that the ruby-proxifier is a gem that ought to be able to help with this: https://github.com/samuelkadolph/ruby-proxifier

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM