rails-reverse-proxy 0.9.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/Gemfile +1 -3
- data/Gemfile.lock +1 -50
- data/README.md +13 -12
- data/VERSION +1 -1
- data/lib/reverse_proxy/client.rb +1 -2
- data/rails-reverse-proxy.gemspec +35 -40
- metadata +5 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b31e671543f6b426dd09ac1a0c13537e3c8f576
|
4
|
+
data.tar.gz: 4282caecc98894c5d186e996b4a58c194442857e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 227805c87472a4adfd188b0106897e96c7f1cf1ffd3fafe9718478b22671ff9b70be5cdcfdf72556bbcfd64b95cbf995a4eb9af5660720e601d50056b698da37
|
7
|
+
data.tar.gz: 2c955e82140e67bc9ce94fa4c383d1a0326f47238c21d984d6c2188fc41d3b49c70d31b364633260758b9fbe52bd253e8a7c1333f1da72fccc5367adf6dd15aa
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.2
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,12 +1,6 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
actionmailer (4.2.1)
|
5
|
-
actionpack (= 4.2.1)
|
6
|
-
actionview (= 4.2.1)
|
7
|
-
activejob (= 4.2.1)
|
8
|
-
mail (~> 2.5, >= 2.5.4)
|
9
|
-
rails-dom-testing (~> 1.0, >= 1.0.5)
|
10
4
|
actionpack (4.2.1)
|
11
5
|
actionview (= 4.2.1)
|
12
6
|
activesupport (= 4.2.1)
|
@@ -20,16 +14,6 @@ GEM
|
|
20
14
|
erubis (~> 2.7.0)
|
21
15
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
22
16
|
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
23
|
-
activejob (4.2.1)
|
24
|
-
activesupport (= 4.2.1)
|
25
|
-
globalid (>= 0.3.0)
|
26
|
-
activemodel (4.2.1)
|
27
|
-
activesupport (= 4.2.1)
|
28
|
-
builder (~> 3.1)
|
29
|
-
activerecord (4.2.1)
|
30
|
-
activemodel (= 4.2.1)
|
31
|
-
activesupport (= 4.2.1)
|
32
|
-
arel (~> 6.0)
|
33
17
|
activesupport (4.2.1)
|
34
18
|
i18n (~> 0.7)
|
35
19
|
json (~> 1.7, >= 1.7.7)
|
@@ -38,7 +22,6 @@ GEM
|
|
38
22
|
tzinfo (~> 1.1)
|
39
23
|
addressable (2.5.0)
|
40
24
|
public_suffix (~> 2.0, >= 2.0.2)
|
41
|
-
arel (6.0.0)
|
42
25
|
builder (3.2.3)
|
43
26
|
descendants_tracker (0.0.4)
|
44
27
|
thread_safe (~> 0.3, >= 0.3.1)
|
@@ -55,8 +38,6 @@ GEM
|
|
55
38
|
multi_json (>= 1.7.5, < 2.0)
|
56
39
|
nokogiri (~> 1.6.0)
|
57
40
|
oauth2
|
58
|
-
globalid (0.3.5)
|
59
|
-
activesupport (>= 4.1.0)
|
60
41
|
hashie (3.5.5)
|
61
42
|
highline (1.7.8)
|
62
43
|
i18n (0.7.0)
|
@@ -74,9 +55,6 @@ GEM
|
|
74
55
|
jwt (1.5.6)
|
75
56
|
loofah (2.0.2)
|
76
57
|
nokogiri (>= 1.5.9)
|
77
|
-
mail (2.6.3)
|
78
|
-
mime-types (>= 1.16, < 3)
|
79
|
-
mime-types (2.6.1)
|
80
58
|
mini_portile2 (2.1.0)
|
81
59
|
minitest (5.7.0)
|
82
60
|
multi_json (1.12.1)
|
@@ -92,21 +70,8 @@ GEM
|
|
92
70
|
rack (>= 1.2, < 3)
|
93
71
|
public_suffix (2.0.5)
|
94
72
|
rack (1.6.5)
|
95
|
-
rack-proxy (0.5.17)
|
96
|
-
rack
|
97
73
|
rack-test (0.6.3)
|
98
74
|
rack (>= 1.0)
|
99
|
-
rails (4.2.1)
|
100
|
-
actionmailer (= 4.2.1)
|
101
|
-
actionpack (= 4.2.1)
|
102
|
-
actionview (= 4.2.1)
|
103
|
-
activejob (= 4.2.1)
|
104
|
-
activemodel (= 4.2.1)
|
105
|
-
activerecord (= 4.2.1)
|
106
|
-
activesupport (= 4.2.1)
|
107
|
-
bundler (>= 1.3.0, < 2.0)
|
108
|
-
railties (= 4.2.1)
|
109
|
-
sprockets-rails
|
110
75
|
rails-deprecated_sanitizer (1.0.3)
|
111
76
|
activesupport (>= 4.2.0.alpha)
|
112
77
|
rails-dom-testing (1.0.6)
|
@@ -115,11 +80,6 @@ GEM
|
|
115
80
|
rails-deprecated_sanitizer (>= 1.0.1)
|
116
81
|
rails-html-sanitizer (1.0.2)
|
117
82
|
loofah (~> 2.0)
|
118
|
-
railties (4.2.1)
|
119
|
-
actionpack (= 4.2.1)
|
120
|
-
activesupport (= 4.2.1)
|
121
|
-
rake (>= 0.8.7)
|
122
|
-
thor (>= 0.18.1, < 2.0)
|
123
83
|
rake (12.0.0)
|
124
84
|
rdoc (3.12.2)
|
125
85
|
json (~> 1.4)
|
@@ -135,13 +95,6 @@ GEM
|
|
135
95
|
json (~> 1.8)
|
136
96
|
simplecov-html (~> 0.10.0)
|
137
97
|
simplecov-html (0.10.0)
|
138
|
-
sprockets (3.2.0)
|
139
|
-
rack (~> 1.0)
|
140
|
-
sprockets-rails (2.3.1)
|
141
|
-
actionpack (>= 3.0)
|
142
|
-
activesupport (>= 3.0)
|
143
|
-
sprockets (>= 2.8, < 4.0)
|
144
|
-
thor (0.19.1)
|
145
98
|
thread_safe (0.3.6)
|
146
99
|
tzinfo (1.2.2)
|
147
100
|
thread_safe (~> 0.1)
|
@@ -150,12 +103,10 @@ PLATFORMS
|
|
150
103
|
ruby
|
151
104
|
|
152
105
|
DEPENDENCIES
|
106
|
+
actionpack
|
153
107
|
addressable
|
154
108
|
bundler (~> 1.0)
|
155
109
|
jeweler (~> 2.1.2)
|
156
|
-
rack
|
157
|
-
rack-proxy
|
158
|
-
rails
|
159
110
|
rdoc (~> 3.12)
|
160
111
|
shoulda
|
161
112
|
simplecov
|
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# rails-reverse-proxy
|
2
2
|
|
3
|
-
|
3
|
+
A reverse proxy for Ruby on Rails.
|
4
|
+
|
5
|
+
*A reverse proxy accepts a request from a client, forwards it to a server that can fulfill it, and returns the server's response to the client*
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
|
-
You know the drill. In your Gemfile
|
9
|
+
You know the drill. In your Gemfile
|
8
10
|
|
9
11
|
```ruby
|
10
12
|
gem 'rails-reverse-proxy'
|
@@ -18,7 +20,9 @@ $ bundle
|
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
21
|
-
|
23
|
+
A use case for this gem is serving WordPress on a path within your Rails application, such as `/blog`.
|
24
|
+
|
25
|
+
To do this, your controller might look like this
|
22
26
|
|
23
27
|
```ruby
|
24
28
|
class WordpressController < ApplicationController
|
@@ -65,13 +69,13 @@ If you'd like to bypass SSL verification
|
|
65
69
|
reverse_proxy "http://localhost:8000", verify_ssl: false
|
66
70
|
```
|
67
71
|
|
68
|
-
If you'd like to customize
|
72
|
+
If you'd like to customize options passed into the underlying [`Net:HTTP`](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html#start-method) object
|
69
73
|
|
70
74
|
```ruby
|
71
75
|
reverse_proxy "http://localhost:8000", http: { read_timeout: 20, open_timeout: 100 }
|
72
76
|
```
|
73
77
|
|
74
|
-
|
78
|
+
Determine what version you're using
|
75
79
|
|
76
80
|
```ruby
|
77
81
|
ReverseProxy.version
|
@@ -83,17 +87,14 @@ Feel free to open an issue!
|
|
83
87
|
|
84
88
|
All pull requests will become first class citizens.
|
85
89
|
|
86
|
-
##
|
90
|
+
## Contributors
|
87
91
|
|
88
|
-
Special thanks to our contributors!
|
92
|
+
Special thanks to our contributors!
|
89
93
|
|
94
|
+
- [mediafinger](https://github.com/mediafinger)
|
90
95
|
- [miyukki](https://github.com/miyukki)
|
91
96
|
- [bapirex](https://github.com/bapirex)
|
92
97
|
- [marcosbeirigo](https://github.com/marcosbeirigo)
|
93
98
|
- [avinashkoulavkar](https://github.com/avinashkoulavkar)
|
94
99
|
- [jcs](https://github.com/jcs)
|
95
|
-
|
96
|
-
## Copyright
|
97
|
-
|
98
|
-
Copyright (c) 2016-2017 James Hu. See [LICENSE](LICENSE) for
|
99
|
-
further details.
|
100
|
+
- [aardvarkk](https://github.com/aardvarkk)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.10.0
|
data/lib/reverse_proxy/client.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'rack'
|
2
|
-
require 'rack-proxy'
|
3
2
|
require 'addressable/uri'
|
4
3
|
|
5
4
|
module ReverseProxy
|
@@ -131,7 +130,7 @@ module ReverseProxy
|
|
131
130
|
|
132
131
|
def extract_http_request_headers(env)
|
133
132
|
headers = env.reject do |k, v|
|
134
|
-
!(/^HTTP_[A-Z_]+$/ === k) || v.nil?
|
133
|
+
!(/^HTTP_[A-Z_]+$/ === k) || k == "HTTP_VERSION" || v.nil?
|
135
134
|
end.map do |k, v|
|
136
135
|
[reconstruct_header_name(k), v]
|
137
136
|
end.inject(Rack::Utils::HeaderHash.new) do |hash, k_v|
|
data/rails-reverse-proxy.gemspec
CHANGED
@@ -2,24 +2,25 @@
|
|
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.10.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "rails-reverse-proxy"
|
9
|
-
s.version = "0.
|
8
|
+
s.name = "rails-reverse-proxy".freeze
|
9
|
+
s.version = "0.10.0"
|
10
10
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["James Hu"]
|
14
|
-
s.date = "
|
15
|
-
s.description = "Reverse proxy for Ruby on Rails"
|
16
|
-
s.email = "hello@james.hu"
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["James Hu".freeze]
|
14
|
+
s.date = "2021-03-24"
|
15
|
+
s.description = "Reverse proxy for Ruby on Rails".freeze
|
16
|
+
s.email = "hello@james.hu".freeze
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE",
|
19
19
|
"README.md"
|
20
20
|
]
|
21
21
|
s.files = [
|
22
22
|
".document",
|
23
|
+
".ruby-version",
|
23
24
|
"Gemfile",
|
24
25
|
"Gemfile.lock",
|
25
26
|
"LICENSE",
|
@@ -33,45 +34,39 @@ Gem::Specification.new do |s|
|
|
33
34
|
"lib/reverse_proxy/controller.rb",
|
34
35
|
"rails-reverse-proxy.gemspec"
|
35
36
|
]
|
36
|
-
s.homepage = "http://github.com/axsuul/rails-reverse-proxy"
|
37
|
-
s.licenses = ["MIT"]
|
38
|
-
s.rubygems_version = "2.
|
39
|
-
s.summary = "Reverse proxy for Ruby on Rails"
|
37
|
+
s.homepage = "http://github.com/axsuul/rails-reverse-proxy".freeze
|
38
|
+
s.licenses = ["MIT".freeze]
|
39
|
+
s.rubygems_version = "2.6.13".freeze
|
40
|
+
s.summary = "Reverse proxy for Ruby on Rails".freeze
|
40
41
|
|
41
42
|
if s.respond_to? :specification_version then
|
42
43
|
s.specification_version = 4
|
43
44
|
|
44
45
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
45
|
-
s.add_runtime_dependency(%q<
|
46
|
-
s.add_runtime_dependency(%q<
|
47
|
-
s.
|
48
|
-
s.
|
49
|
-
s.add_development_dependency(%q<
|
50
|
-
s.add_development_dependency(%q<
|
51
|
-
s.add_development_dependency(%q<
|
52
|
-
s.add_development_dependency(%q<jeweler>, ["~> 2.1.2"])
|
53
|
-
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
46
|
+
s.add_runtime_dependency(%q<actionpack>.freeze, [">= 0"])
|
47
|
+
s.add_runtime_dependency(%q<addressable>.freeze, [">= 0"])
|
48
|
+
s.add_development_dependency(%q<shoulda>.freeze, [">= 0"])
|
49
|
+
s.add_development_dependency(%q<rdoc>.freeze, ["~> 3.12"])
|
50
|
+
s.add_development_dependency(%q<bundler>.freeze, ["~> 1.0"])
|
51
|
+
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.1.2"])
|
52
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
54
53
|
else
|
55
|
-
s.add_dependency(%q<
|
56
|
-
s.add_dependency(%q<
|
57
|
-
s.add_dependency(%q<
|
58
|
-
s.add_dependency(%q<
|
59
|
-
s.add_dependency(%q<
|
60
|
-
s.add_dependency(%q<
|
61
|
-
s.add_dependency(%q<
|
62
|
-
s.add_dependency(%q<jeweler>, ["~> 2.1.2"])
|
63
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
54
|
+
s.add_dependency(%q<actionpack>.freeze, [">= 0"])
|
55
|
+
s.add_dependency(%q<addressable>.freeze, [">= 0"])
|
56
|
+
s.add_dependency(%q<shoulda>.freeze, [">= 0"])
|
57
|
+
s.add_dependency(%q<rdoc>.freeze, ["~> 3.12"])
|
58
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 1.0"])
|
59
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 2.1.2"])
|
60
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
64
61
|
end
|
65
62
|
else
|
66
|
-
s.add_dependency(%q<
|
67
|
-
s.add_dependency(%q<
|
68
|
-
s.add_dependency(%q<
|
69
|
-
s.add_dependency(%q<
|
70
|
-
s.add_dependency(%q<
|
71
|
-
s.add_dependency(%q<
|
72
|
-
s.add_dependency(%q<
|
73
|
-
s.add_dependency(%q<jeweler>, ["~> 2.1.2"])
|
74
|
-
s.add_dependency(%q<simplecov>, [">= 0"])
|
63
|
+
s.add_dependency(%q<actionpack>.freeze, [">= 0"])
|
64
|
+
s.add_dependency(%q<addressable>.freeze, [">= 0"])
|
65
|
+
s.add_dependency(%q<shoulda>.freeze, [">= 0"])
|
66
|
+
s.add_dependency(%q<rdoc>.freeze, ["~> 3.12"])
|
67
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 1.0"])
|
68
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 2.1.2"])
|
69
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
75
70
|
end
|
76
71
|
end
|
77
72
|
|
metadata
CHANGED
@@ -1,45 +1,17 @@
|
|
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.10.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:
|
11
|
+
date: 2021-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rack
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rack-proxy
|
14
|
+
name: actionpack
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
44
16
|
requirements:
|
45
17
|
- - ">="
|
@@ -145,6 +117,7 @@ extra_rdoc_files:
|
|
145
117
|
- README.md
|
146
118
|
files:
|
147
119
|
- ".document"
|
120
|
+
- ".ruby-version"
|
148
121
|
- Gemfile
|
149
122
|
- Gemfile.lock
|
150
123
|
- LICENSE
|
@@ -177,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
150
|
version: '0'
|
178
151
|
requirements: []
|
179
152
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.
|
153
|
+
rubygems_version: 2.6.13
|
181
154
|
signing_key:
|
182
155
|
specification_version: 4
|
183
156
|
summary: Reverse proxy for Ruby on Rails
|