rails-reverse-proxy 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -2
- data/VERSION +1 -1
- data/lib/reverse_proxy/client.rb +10 -5
- data/rails-reverse-proxy.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b360ee4c361f26e4c2182bdd20e4348af835ca7
|
4
|
+
data.tar.gz: 73c8d8972c066241ae4834a34148ab6ecebfe33f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afc6bc62f37962e1f6f9022590d2dc6e7f599dd763f76673cc1f4bb6794c7d126ad595294ae3cdb773d56c22070faff0c6282049a264528fc3c77b95b2e872a5
|
7
|
+
data.tar.gz: 3a0e28009255950571604c0cc6976b25b37064d077ee908d977c1e0b45f07fc92d5996e8378b2e13d025e7c8ca380529faffe3ad4c37b748673747d566da39f5
|
data/README.md
CHANGED
@@ -58,7 +58,19 @@ You can also pass options into `reverse_proxy`
|
|
58
58
|
reverse_proxy "http://localhost:8000", path: "custom-path", headers: { 'X-Foo' => "Bar" }
|
59
59
|
```
|
60
60
|
|
61
|
-
|
61
|
+
If you'd like to bypass SSL verification
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
reverse_proxy "http://localhost:8000", verify_ssl: false
|
65
|
+
```
|
66
|
+
|
67
|
+
Use this method to determine what version you're running
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
ReverseProxy.version
|
71
|
+
```
|
72
|
+
|
73
|
+
Feel free to open an issue!
|
62
74
|
|
63
75
|
## Contributing
|
64
76
|
|
@@ -73,6 +85,6 @@ Special thanks to our contributors!
|
|
73
85
|
|
74
86
|
## Copyright
|
75
87
|
|
76
|
-
Copyright (c) 2016 James Hu. See LICENSE
|
88
|
+
Copyright (c) 2016 James Hu. See [LICENSE](LICENSE) for
|
77
89
|
further details.
|
78
90
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.0
|
data/lib/reverse_proxy/client.rb
CHANGED
@@ -37,10 +37,11 @@ module ReverseProxy
|
|
37
37
|
|
38
38
|
def request(env, options = {}, &block)
|
39
39
|
options.reverse_merge!(
|
40
|
-
headers:
|
41
|
-
path:
|
42
|
-
username:
|
43
|
-
password:
|
40
|
+
headers: {},
|
41
|
+
path: nil,
|
42
|
+
username: nil,
|
43
|
+
password: nil,
|
44
|
+
verify_ssl: true
|
44
45
|
)
|
45
46
|
|
46
47
|
source_request = Rack::Request.new(env)
|
@@ -78,8 +79,12 @@ module ReverseProxy
|
|
78
79
|
# within Varnish (503)
|
79
80
|
target_request['Accept-Encoding'] = nil
|
80
81
|
|
82
|
+
http_options = {}
|
83
|
+
http_options[:use_ssl] = (uri.scheme == "https")
|
84
|
+
http_options[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if options[:verify_ssl]
|
85
|
+
|
81
86
|
# Make the request
|
82
|
-
Net::HTTP.start(uri.hostname, uri.port,
|
87
|
+
Net::HTTP.start(uri.hostname, uri.port, http_options) do |http|
|
83
88
|
target_response = http.request(target_request)
|
84
89
|
end
|
85
90
|
|
data/rails-reverse-proxy.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: rails-reverse-proxy 0.
|
5
|
+
# stub: rails-reverse-proxy 0.7.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "rails-reverse-proxy"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.7.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["James Hu"]
|
14
|
-
s.date = "2016-10-
|
14
|
+
s.date = "2016-10-12"
|
15
15
|
s.description = "Reverse proxy for Ruby on Rails"
|
16
16
|
s.email = "hello@james.hu"
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-reverse-proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Hu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|