开发者

forcing all http requests to follow system proxy configuration

开发者 https://www.devze.com 2023-03-21 00:00 出处:网络
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 co

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 configuratio开发者_高级运维n.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号