Change http_options to http

This commit is contained in:
James Hu 2017-03-11 22:50:36 -08:00
parent 6206704f6e
commit 27b3ba8c96
2 changed files with 3 additions and 3 deletions

View File

@ -64,10 +64,10 @@ If you'd like to bypass SSL verification
reverse_proxy "http://localhost:8000", verify_ssl: false reverse_proxy "http://localhost:8000", verify_ssl: false
``` ```
If you'd like to more customize your [HTTP optional hash](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html#start-method), If you'd like to customize the options passed into the [HTTP session](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html#start-method)
```ruby ```ruby
reverse_proxy "http://localhost:8000", http_options: {read_timeout: 20, open_timeout: 100} reverse_proxy "http://localhost:8000", http: { read_timeout: 20, open_timeout: 100 }
``` ```
Use this method to determine what version you're running Use this method to determine what version you're running

View File

@ -83,7 +83,7 @@ module ReverseProxy
http_options = {} http_options = {}
http_options[:use_ssl] = (uri.scheme == "https") http_options[:use_ssl] = (uri.scheme == "https")
http_options[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if options[:verify_ssl] http_options[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if options[:verify_ssl]
http_options.merge!(options[:http_options]) if options[:http_options] http_options.merge!(options[:http]) if options[:http]
# Make the request # Make the request
Net::HTTP.start(uri.hostname, uri.port, http_options) do |http| Net::HTTP.start(uri.hostname, uri.port, http_options) do |http|