Open starrychloe opened 5 years ago
Implemented proxy support in my fork https://github.com/axvm/rails-reverse-proxy
How to use:
reverse_proxy 'https://google.com', headers: { Host: 'google.com' }, proxy: { host: '127.0.0.1', port: 8888 } do
# implement here your callbacks
end
If you want to use this proxy for the whole app, it might be easier to use "http_proxy" environment variable, since it is automatically picked up by Net::HTTP and other networking libraries.
export http_proxy=localhost:7777
I'd like to specify Fiddler as a proxy so I can inspect the requests and responses easier. I need to specify localhost:7777 as a proxy. However, this doesn't allow proxy parameters, even though Net::HTTP does. The docs say you can provide a
http: {}
hash but the options to the linked method are only about certificates. The proxy host and proxy port are given by the 3rd and 4th arguments, and you can't specify them via a hash of options.https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html#start-method