experella-proxy 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/experella-proxy +5 -5
- data/config/default/config.rb +15 -16
- data/dev/experella-proxy +3 -4
- data/experella-proxy.gemspec +2 -2
- data/lib/experella-proxy/backend.rb +3 -5
- data/lib/experella-proxy/backend_server.rb +20 -22
- data/lib/experella-proxy/configuration.rb +19 -23
- data/lib/experella-proxy/connection.rb +29 -37
- data/lib/experella-proxy/connection_manager.rb +16 -21
- data/lib/experella-proxy/globals.rb +5 -7
- data/lib/experella-proxy/http_status_codes.rb +37 -38
- data/lib/experella-proxy/proxy.rb +8 -9
- data/lib/experella-proxy/request.rb +12 -13
- data/lib/experella-proxy/response.rb +28 -34
- data/lib/experella-proxy/server.rb +1 -6
- data/lib/experella-proxy/version.rb +5 -1
- data/lib/experella-proxy.rb +9 -10
- data/spec/echo-server/echo_server.rb +4 -6
- data/spec/experella-proxy/backend_server_spec.rb +16 -18
- data/spec/experella-proxy/configuration_spec.rb +4 -4
- data/spec/experella-proxy/connection_manager_spec.rb +15 -16
- data/spec/experella-proxy/experella-proxy_spec.rb +73 -76
- data/spec/experella-proxy/request_spec.rb +7 -7
- data/spec/experella-proxy/response_spec.rb +6 -6
- data/spec/fixtures/spec.log +187 -187
- data/spec/fixtures/test_config.rb +8 -10
- data/spec/spec_helper.rb +4 -5
- data/test/sinatra/hello_world_server.rb +0 -3
- data/test/sinatra/server_one.rb +1 -4
- data/test/sinatra/server_two.rb +2 -4
- metadata +3 -3
@@ -2,9 +2,9 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe ExperellaProxy::Response do
|
4
4
|
|
5
|
-
let(:response)
|
5
|
+
let(:response) do
|
6
6
|
ExperellaProxy::Response.new(ExperellaProxy::Request.new("conn"))
|
7
|
-
|
7
|
+
end
|
8
8
|
|
9
9
|
describe "#new" do
|
10
10
|
|
@@ -24,14 +24,14 @@ describe ExperellaProxy::Response do
|
|
24
24
|
it "overwrites values of existing keys" do
|
25
25
|
response.update_header("Host" => "xyz", :response_url => "abcd")
|
26
26
|
response.update_header("Host" => "abc")
|
27
|
-
response.header.should eql(
|
27
|
+
response.header.should eql(:Host => "abc", :response_url => "abcd")
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
describe "#reconstruct_header" do
|
32
32
|
it "writes a valid http header into send_buffer" do
|
33
|
-
response.update_header(
|
34
|
-
|
33
|
+
response.update_header("Connection" => "keep-alive",
|
34
|
+
:"Via-X" => %w(Lukas Amy George))
|
35
35
|
response.reconstruct_header
|
36
36
|
data = response.flush
|
37
37
|
data.start_with?("HTTP/1.1 500 Internal Server Error\r\n").should be_true
|
@@ -41,4 +41,4 @@ describe ExperellaProxy::Response do
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
end
|
44
|
+
end
|
data/spec/fixtures/spec.log
CHANGED
@@ -1,187 +1,187 @@
|
|
1
|
-
I, [2014-04-
|
2
|
-
I, [2014-04-
|
3
|
-
I, [2014-04-
|
4
|
-
I, [2014-04-
|
5
|
-
I, [2014-04-
|
6
|
-
I, [2014-04-
|
7
|
-
I, [2014-04-
|
8
|
-
I, [2014-04-
|
9
|
-
I, [2014-04-
|
10
|
-
I, [2014-04-
|
11
|
-
I, [2014-04-
|
12
|
-
I, [2014-04-
|
13
|
-
I, [2014-04-
|
14
|
-
I, [2014-04-
|
15
|
-
I, [2014-04-
|
16
|
-
I, [2014-04-
|
17
|
-
I, [2014-04-
|
18
|
-
I, [2014-04-
|
19
|
-
I, [2014-04-
|
20
|
-
I, [2014-04-
|
21
|
-
I, [2014-04-
|
22
|
-
I, [2014-04-
|
23
|
-
I, [2014-04-
|
24
|
-
I, [2014-04-
|
25
|
-
I, [2014-04-
|
26
|
-
I, [2014-04-
|
27
|
-
I, [2014-04-
|
28
|
-
I, [2014-04-
|
29
|
-
I, [2014-04-
|
30
|
-
I, [2014-04-
|
31
|
-
I, [2014-04-
|
32
|
-
I, [2014-04-
|
33
|
-
I, [2014-04-
|
34
|
-
I, [2014-04-
|
35
|
-
I, [2014-04-
|
36
|
-
I, [2014-04-
|
37
|
-
I, [2014-04-
|
38
|
-
I, [2014-04-
|
39
|
-
I, [2014-04-
|
40
|
-
I, [2014-04-
|
41
|
-
I, [2014-04-
|
42
|
-
I, [2014-04-
|
43
|
-
I, [2014-04-
|
44
|
-
I, [2014-04-
|
45
|
-
I, [2014-04-
|
46
|
-
I, [2014-04-
|
47
|
-
I, [2014-04-
|
48
|
-
I, [2014-04-
|
49
|
-
I, [2014-04-
|
50
|
-
I, [2014-04-
|
51
|
-
I, [2014-04-
|
52
|
-
I, [2014-04-
|
53
|
-
I, [2014-04-
|
54
|
-
I, [2014-04-
|
55
|
-
I, [2014-04-
|
56
|
-
I, [2014-04-
|
57
|
-
I, [2014-04-
|
58
|
-
I, [2014-04-
|
59
|
-
I, [2014-04-
|
60
|
-
I, [2014-04-
|
61
|
-
I, [2014-04-
|
62
|
-
I, [2014-04-
|
63
|
-
I, [2014-04-
|
64
|
-
I, [2014-04-
|
65
|
-
I, [2014-04-
|
66
|
-
I, [2014-04-
|
67
|
-
I, [2014-04-
|
68
|
-
I, [2014-04-
|
69
|
-
I, [2014-04-
|
70
|
-
I, [2014-04-
|
71
|
-
I, [2014-04-
|
72
|
-
I, [2014-04-
|
73
|
-
I, [2014-04-
|
74
|
-
I, [2014-04-
|
75
|
-
I, [2014-04-
|
76
|
-
I, [2014-04-
|
77
|
-
I, [2014-04-
|
78
|
-
I, [2014-04-
|
79
|
-
I, [2014-04-
|
80
|
-
I, [2014-04-
|
81
|
-
I, [2014-04-
|
82
|
-
I, [2014-04-
|
83
|
-
I, [2014-04-
|
84
|
-
I, [2014-04-
|
85
|
-
I, [2014-04-
|
86
|
-
I, [2014-04-
|
87
|
-
I, [2014-04-
|
88
|
-
I, [2014-04-
|
89
|
-
I, [2014-04-
|
90
|
-
I, [2014-04-
|
91
|
-
I, [2014-04-
|
92
|
-
I, [2014-04-
|
93
|
-
I, [2014-04-
|
94
|
-
I, [2014-04-
|
95
|
-
I, [2014-04-
|
96
|
-
I, [2014-04-
|
97
|
-
I, [2014-04-
|
98
|
-
I, [2014-04-
|
99
|
-
I, [2014-04-
|
100
|
-
I, [2014-04-
|
101
|
-
I, [2014-04-
|
102
|
-
I, [2014-04-
|
103
|
-
I, [2014-04-
|
104
|
-
I, [2014-04-
|
105
|
-
I, [2014-04-
|
106
|
-
I, [2014-04-
|
107
|
-
I, [2014-04-
|
108
|
-
I, [2014-04-
|
109
|
-
I, [2014-04-
|
110
|
-
I, [2014-04-
|
111
|
-
I, [2014-04-
|
112
|
-
I, [2014-04-
|
113
|
-
I, [2014-04-
|
114
|
-
I, [2014-04-
|
115
|
-
I, [2014-04-
|
116
|
-
I, [2014-04-
|
117
|
-
I, [2014-04-
|
118
|
-
I, [2014-04-
|
119
|
-
I, [2014-04-
|
120
|
-
I, [2014-04-
|
121
|
-
I, [2014-04-
|
122
|
-
I, [2014-04-
|
123
|
-
I, [2014-04-
|
124
|
-
I, [2014-04-
|
125
|
-
I, [2014-04-
|
126
|
-
I, [2014-04-
|
127
|
-
I, [2014-04-
|
128
|
-
I, [2014-04-
|
129
|
-
I, [2014-04-
|
130
|
-
I, [2014-04-
|
131
|
-
I, [2014-04-
|
132
|
-
I, [2014-04-
|
133
|
-
I, [2014-04-
|
134
|
-
I, [2014-04-
|
135
|
-
I, [2014-04-
|
136
|
-
I, [2014-04-
|
137
|
-
I, [2014-04-
|
138
|
-
I, [2014-04-
|
139
|
-
I, [2014-04-
|
140
|
-
I, [2014-04-
|
141
|
-
I, [2014-04-
|
142
|
-
I, [2014-04-
|
143
|
-
I, [2014-04-
|
144
|
-
I, [2014-04-
|
145
|
-
I, [2014-04-
|
146
|
-
I, [2014-04-
|
147
|
-
I, [2014-04-
|
148
|
-
I, [2014-04-
|
149
|
-
I, [2014-04-
|
150
|
-
I, [2014-04-
|
151
|
-
I, [2014-04-
|
152
|
-
I, [2014-04-
|
153
|
-
I, [2014-04-
|
154
|
-
I, [2014-04-
|
155
|
-
I, [2014-04-
|
156
|
-
I, [2014-04-
|
157
|
-
I, [2014-04-
|
158
|
-
I, [2014-04-
|
159
|
-
I, [2014-04-
|
160
|
-
I, [2014-04-
|
161
|
-
I, [2014-04-
|
162
|
-
I, [2014-04-
|
163
|
-
I, [2014-04-
|
164
|
-
I, [2014-04-
|
165
|
-
I, [2014-04-
|
166
|
-
I, [2014-04-
|
167
|
-
I, [2014-04-
|
168
|
-
I, [2014-04-
|
169
|
-
I, [2014-04-
|
170
|
-
I, [2014-04-
|
171
|
-
I, [2014-04-
|
172
|
-
I, [2014-04-
|
173
|
-
I, [2014-04-
|
174
|
-
I, [2014-04-
|
175
|
-
I, [2014-04-
|
176
|
-
I, [2014-04-
|
177
|
-
I, [2014-04-
|
178
|
-
I, [2014-04-
|
179
|
-
I, [2014-04-
|
180
|
-
I, [2014-04-
|
181
|
-
I, [2014-04-
|
182
|
-
I, [2014-04-
|
183
|
-
I, [2014-04-
|
184
|
-
I, [2014-04-
|
185
|
-
I, [2014-04-
|
186
|
-
I, [2014-04-
|
187
|
-
I, [2014-04-
|
1
|
+
I, [2014-04-30T14:37:47.573712 #28734] INFO -- : should reuse keep-alive connections
|
2
|
+
I, [2014-04-30T14:37:47.029278 #28740] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
3
|
+
I, [2014-04-30T14:37:47.029336 #28740] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$"}
|
4
|
+
I, [2014-04-30T14:37:47.029352 #28740] INFO -- : Backend mangles: nil
|
5
|
+
I, [2014-04-30T14:37:47.029383 #28740] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
6
|
+
I, [2014-04-30T14:37:47.029400 #28740] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$"}
|
7
|
+
I, [2014-04-30T14:37:47.029413 #28740] INFO -- : Backend mangles: nil
|
8
|
+
I, [2014-04-30T14:37:47.029447 #28740] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
9
|
+
I, [2014-04-30T14:37:47.029470 #28740] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"/(oneroute|anotherpath)($|/)"}
|
10
|
+
I, [2014-04-30T14:37:47.029483 #28740] INFO -- : Backend mangles: nil
|
11
|
+
I, [2014-04-30T14:37:47.029511 #28740] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
12
|
+
I, [2014-04-30T14:37:47.029526 #28740] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
13
|
+
I, [2014-04-30T14:37:47.029539 #28740] INFO -- : Backend mangles: nil
|
14
|
+
I, [2014-04-30T14:37:47.029655 #28740] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
15
|
+
I, [2014-04-30T14:37:47.029671 #28740] INFO -- : with options: {}
|
16
|
+
I, [2014-04-30T14:37:47.029733 #28740] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
17
|
+
I, [2014-04-30T14:37:47.029748 #28740] INFO -- : with options: {}
|
18
|
+
I, [2014-04-30T14:37:49.583070 #28734] INFO -- : should respond with 400 on malformed request
|
19
|
+
I, [2014-04-30T14:37:49.047584 #28742] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
20
|
+
I, [2014-04-30T14:37:49.047633 #28742] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
21
|
+
I, [2014-04-30T14:37:49.047649 #28742] INFO -- : Backend mangles: nil
|
22
|
+
I, [2014-04-30T14:37:49.047680 #28742] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
23
|
+
I, [2014-04-30T14:37:49.047697 #28742] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
24
|
+
I, [2014-04-30T14:37:49.047710 #28742] INFO -- : Backend mangles: nil
|
25
|
+
I, [2014-04-30T14:37:49.047743 #28742] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
26
|
+
I, [2014-04-30T14:37:49.047774 #28742] INFO -- : Backend accepts: {"request_url"=>"/(oneroute|anotherpath)($|/)", "Host"=>"experella"}
|
27
|
+
I, [2014-04-30T14:37:49.047788 #28742] INFO -- : Backend mangles: nil
|
28
|
+
I, [2014-04-30T14:37:49.047824 #28742] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
29
|
+
I, [2014-04-30T14:37:49.047871 #28742] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
30
|
+
I, [2014-04-30T14:37:49.047885 #28742] INFO -- : Backend mangles: nil
|
31
|
+
I, [2014-04-30T14:37:49.048001 #28742] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
32
|
+
I, [2014-04-30T14:37:49.048017 #28742] INFO -- : with options: {}
|
33
|
+
I, [2014-04-30T14:37:49.048075 #28742] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
34
|
+
I, [2014-04-30T14:37:49.048090 #28742] INFO -- : with options: {}
|
35
|
+
I, [2014-04-30T14:37:51.593776 #28734] INFO -- : should get response from the echoserver via the proxy
|
36
|
+
I, [2014-04-30T14:37:51.048677 #28745] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
37
|
+
I, [2014-04-30T14:37:51.048729 #28745] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$"}
|
38
|
+
I, [2014-04-30T14:37:51.048744 #28745] INFO -- : Backend mangles: nil
|
39
|
+
I, [2014-04-30T14:37:51.048774 #28745] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
40
|
+
I, [2014-04-30T14:37:51.048791 #28745] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$"}
|
41
|
+
I, [2014-04-30T14:37:51.048804 #28745] INFO -- : Backend mangles: nil
|
42
|
+
I, [2014-04-30T14:37:51.048838 #28745] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
43
|
+
I, [2014-04-30T14:37:51.048860 #28745] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"/(oneroute|anotherpath)($|/)"}
|
44
|
+
I, [2014-04-30T14:37:51.048874 #28745] INFO -- : Backend mangles: nil
|
45
|
+
I, [2014-04-30T14:37:51.048902 #28745] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
46
|
+
I, [2014-04-30T14:37:51.048917 #28745] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
47
|
+
I, [2014-04-30T14:37:51.048930 #28745] INFO -- : Backend mangles: nil
|
48
|
+
I, [2014-04-30T14:37:51.049040 #28745] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
49
|
+
I, [2014-04-30T14:37:51.049057 #28745] INFO -- : with options: {}
|
50
|
+
I, [2014-04-30T14:37:51.049116 #28745] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
51
|
+
I, [2014-04-30T14:37:51.049131 #28745] INFO -- : with options: {}
|
52
|
+
I, [2014-04-30T14:37:53.601460 #28734] INFO -- : should be able to handle post requests
|
53
|
+
I, [2014-04-30T14:37:53.059325 #28750] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
54
|
+
I, [2014-04-30T14:37:53.059375 #28750] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$"}
|
55
|
+
I, [2014-04-30T14:37:53.059391 #28750] INFO -- : Backend mangles: nil
|
56
|
+
I, [2014-04-30T14:37:53.059422 #28750] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
57
|
+
I, [2014-04-30T14:37:53.059440 #28750] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$"}
|
58
|
+
I, [2014-04-30T14:37:53.059453 #28750] INFO -- : Backend mangles: nil
|
59
|
+
I, [2014-04-30T14:37:53.059486 #28750] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
60
|
+
I, [2014-04-30T14:37:53.059509 #28750] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"/(oneroute|anotherpath)($|/)"}
|
61
|
+
I, [2014-04-30T14:37:53.059523 #28750] INFO -- : Backend mangles: nil
|
62
|
+
I, [2014-04-30T14:37:53.059554 #28750] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
63
|
+
I, [2014-04-30T14:37:53.059570 #28750] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
64
|
+
I, [2014-04-30T14:37:53.059582 #28750] INFO -- : Backend mangles: nil
|
65
|
+
I, [2014-04-30T14:37:53.059696 #28750] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
66
|
+
I, [2014-04-30T14:37:53.059712 #28750] INFO -- : with options: {}
|
67
|
+
I, [2014-04-30T14:37:53.059771 #28750] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
68
|
+
I, [2014-04-30T14:37:53.059785 #28750] INFO -- : with options: {}
|
69
|
+
I, [2014-04-30T14:37:55.609122 #28734] INFO -- : should respond with 404
|
70
|
+
I, [2014-04-30T14:37:55.062497 #28752] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
71
|
+
I, [2014-04-30T14:37:55.062554 #28752] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
72
|
+
I, [2014-04-30T14:37:55.062571 #28752] INFO -- : Backend mangles: nil
|
73
|
+
I, [2014-04-30T14:37:55.062603 #28752] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
74
|
+
I, [2014-04-30T14:37:55.062621 #28752] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
75
|
+
I, [2014-04-30T14:37:55.062635 #28752] INFO -- : Backend mangles: nil
|
76
|
+
I, [2014-04-30T14:37:55.062671 #28752] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
77
|
+
I, [2014-04-30T14:37:55.062695 #28752] INFO -- : Backend accepts: {"request_url"=>"/(oneroute|anotherpath)($|/)", "Host"=>"experella"}
|
78
|
+
I, [2014-04-30T14:37:55.062710 #28752] INFO -- : Backend mangles: nil
|
79
|
+
I, [2014-04-30T14:37:55.062739 #28752] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
80
|
+
I, [2014-04-30T14:37:55.062756 #28752] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
81
|
+
I, [2014-04-30T14:37:55.062769 #28752] INFO -- : Backend mangles: nil
|
82
|
+
I, [2014-04-30T14:37:55.062888 #28752] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
83
|
+
I, [2014-04-30T14:37:55.062906 #28752] INFO -- : with options: {}
|
84
|
+
I, [2014-04-30T14:37:55.062967 #28752] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
85
|
+
I, [2014-04-30T14:37:55.062983 #28752] INFO -- : with options: {}
|
86
|
+
I, [2014-04-30T14:37:57.617753 #28734] INFO -- : should rechunk and stream Transfer-Encoding chunked responses
|
87
|
+
I, [2014-04-30T14:37:57.073408 #28757] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
88
|
+
I, [2014-04-30T14:37:57.073459 #28757] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
89
|
+
I, [2014-04-30T14:37:57.073474 #28757] INFO -- : Backend mangles: nil
|
90
|
+
I, [2014-04-30T14:37:57.073505 #28757] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
91
|
+
I, [2014-04-30T14:37:57.073522 #28757] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
92
|
+
I, [2014-04-30T14:37:57.073549 #28757] INFO -- : Backend mangles: nil
|
93
|
+
I, [2014-04-30T14:37:57.073585 #28757] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
94
|
+
I, [2014-04-30T14:37:57.073607 #28757] INFO -- : Backend accepts: {"request_url"=>"/(oneroute|anotherpath)($|/)", "Host"=>"experella"}
|
95
|
+
I, [2014-04-30T14:37:57.073621 #28757] INFO -- : Backend mangles: nil
|
96
|
+
I, [2014-04-30T14:37:57.073649 #28757] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
97
|
+
I, [2014-04-30T14:37:57.073664 #28757] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
98
|
+
I, [2014-04-30T14:37:57.073677 #28757] INFO -- : Backend mangles: nil
|
99
|
+
I, [2014-04-30T14:37:57.073788 #28757] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
100
|
+
I, [2014-04-30T14:37:57.073804 #28757] INFO -- : with options: {}
|
101
|
+
I, [2014-04-30T14:37:57.073864 #28757] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
102
|
+
I, [2014-04-30T14:37:57.073879 #28757] INFO -- : with options: {}
|
103
|
+
I, [2014-04-30T14:37:59.626074 #28734] INFO -- : should accept requests on all set proxy domains
|
104
|
+
I, [2014-04-30T14:37:59.082580 #28760] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
105
|
+
I, [2014-04-30T14:37:59.082632 #28760] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$"}
|
106
|
+
I, [2014-04-30T14:37:59.082649 #28760] INFO -- : Backend mangles: nil
|
107
|
+
I, [2014-04-30T14:37:59.082680 #28760] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
108
|
+
I, [2014-04-30T14:37:59.082698 #28760] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$"}
|
109
|
+
I, [2014-04-30T14:37:59.082711 #28760] INFO -- : Backend mangles: nil
|
110
|
+
I, [2014-04-30T14:37:59.082747 #28760] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
111
|
+
I, [2014-04-30T14:37:59.082770 #28760] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"/(oneroute|anotherpath)($|/)"}
|
112
|
+
I, [2014-04-30T14:37:59.082784 #28760] INFO -- : Backend mangles: nil
|
113
|
+
I, [2014-04-30T14:37:59.082812 #28760] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
114
|
+
I, [2014-04-30T14:37:59.082828 #28760] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
115
|
+
I, [2014-04-30T14:37:59.082841 #28760] INFO -- : Backend mangles: nil
|
116
|
+
I, [2014-04-30T14:37:59.082956 #28760] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
117
|
+
I, [2014-04-30T14:37:59.082972 #28760] INFO -- : with options: {}
|
118
|
+
I, [2014-04-30T14:37:59.083034 #28760] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
119
|
+
I, [2014-04-30T14:37:59.083050 #28760] INFO -- : with options: {}
|
120
|
+
I, [2014-04-30T14:38:01.637772 #28734] INFO -- : should respond with 503
|
121
|
+
I, [2014-04-30T14:38:01.100091 #28763] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
122
|
+
I, [2014-04-30T14:38:01.100140 #28763] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
123
|
+
I, [2014-04-30T14:38:01.100155 #28763] INFO -- : Backend mangles: nil
|
124
|
+
I, [2014-04-30T14:38:01.100185 #28763] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
125
|
+
I, [2014-04-30T14:38:01.100202 #28763] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
126
|
+
I, [2014-04-30T14:38:01.100214 #28763] INFO -- : Backend mangles: nil
|
127
|
+
I, [2014-04-30T14:38:01.100247 #28763] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
128
|
+
I, [2014-04-30T14:38:01.100269 #28763] INFO -- : Backend accepts: {"request_url"=>"/(oneroute|anotherpath)($|/)", "Host"=>"experella"}
|
129
|
+
I, [2014-04-30T14:38:01.100282 #28763] INFO -- : Backend mangles: nil
|
130
|
+
I, [2014-04-30T14:38:01.100309 #28763] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
131
|
+
I, [2014-04-30T14:38:01.100325 #28763] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
132
|
+
I, [2014-04-30T14:38:01.100337 #28763] INFO -- : Backend mangles: nil
|
133
|
+
I, [2014-04-30T14:38:01.100443 #28763] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
134
|
+
I, [2014-04-30T14:38:01.100458 #28763] INFO -- : with options: {}
|
135
|
+
I, [2014-04-30T14:38:01.100519 #28763] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
136
|
+
I, [2014-04-30T14:38:01.100533 #28763] INFO -- : with options: {}
|
137
|
+
I, [2014-04-30T14:38:03.645729 #28734] INFO -- : should handle pipelined requests correctly
|
138
|
+
I, [2014-04-30T14:38:03.105831 #28771] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
139
|
+
I, [2014-04-30T14:38:03.105880 #28771] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$"}
|
140
|
+
I, [2014-04-30T14:38:03.105896 #28771] INFO -- : Backend mangles: nil
|
141
|
+
I, [2014-04-30T14:38:03.105925 #28771] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
142
|
+
I, [2014-04-30T14:38:03.105942 #28771] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$"}
|
143
|
+
I, [2014-04-30T14:38:03.105955 #28771] INFO -- : Backend mangles: nil
|
144
|
+
I, [2014-04-30T14:38:03.105988 #28771] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
145
|
+
I, [2014-04-30T14:38:03.106010 #28771] INFO -- : Backend accepts: {"Host"=>"experella", "request_url"=>"/(oneroute|anotherpath)($|/)"}
|
146
|
+
I, [2014-04-30T14:38:03.106023 #28771] INFO -- : Backend mangles: nil
|
147
|
+
I, [2014-04-30T14:38:03.106050 #28771] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
148
|
+
I, [2014-04-30T14:38:03.106066 #28771] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
149
|
+
I, [2014-04-30T14:38:03.106078 #28771] INFO -- : Backend mangles: nil
|
150
|
+
I, [2014-04-30T14:38:03.106186 #28771] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
151
|
+
I, [2014-04-30T14:38:03.106202 #28771] INFO -- : with options: {}
|
152
|
+
I, [2014-04-30T14:38:03.106260 #28771] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
153
|
+
I, [2014-04-30T14:38:03.106275 #28771] INFO -- : with options: {}
|
154
|
+
I, [2014-04-30T14:38:05.657744 #28734] INFO -- : should stream chunked post requests
|
155
|
+
I, [2014-04-30T14:38:05.114588 #28773] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
156
|
+
I, [2014-04-30T14:38:05.114637 #28773] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
157
|
+
I, [2014-04-30T14:38:05.114652 #28773] INFO -- : Backend mangles: nil
|
158
|
+
I, [2014-04-30T14:38:05.114683 #28773] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
159
|
+
I, [2014-04-30T14:38:05.114700 #28773] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
160
|
+
I, [2014-04-30T14:38:05.114713 #28773] INFO -- : Backend mangles: nil
|
161
|
+
I, [2014-04-30T14:38:05.114746 #28773] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
162
|
+
I, [2014-04-30T14:38:05.114768 #28773] INFO -- : Backend accepts: {"request_url"=>"/(oneroute|anotherpath)($|/)", "Host"=>"experella"}
|
163
|
+
I, [2014-04-30T14:38:05.114781 #28773] INFO -- : Backend mangles: nil
|
164
|
+
I, [2014-04-30T14:38:05.114809 #28773] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
165
|
+
I, [2014-04-30T14:38:05.114825 #28773] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
166
|
+
I, [2014-04-30T14:38:05.114837 #28773] INFO -- : Backend mangles: nil
|
167
|
+
I, [2014-04-30T14:38:05.114943 #28773] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
168
|
+
I, [2014-04-30T14:38:05.114959 #28773] INFO -- : with options: {}
|
169
|
+
I, [2014-04-30T14:38:05.115018 #28773] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
170
|
+
I, [2014-04-30T14:38:05.115032 #28773] INFO -- : with options: {}
|
171
|
+
I, [2014-04-30T14:38:07.677676 #28734] INFO -- : should timeout inactive connections after config.timeout
|
172
|
+
I, [2014-04-30T14:38:07.135546 #28778] INFO -- : Initializing backend experella1 at 127.0.0.10:7654 with concurrency 1
|
173
|
+
I, [2014-04-30T14:38:07.135597 #28778] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
174
|
+
I, [2014-04-30T14:38:07.135614 #28778] INFO -- : Backend mangles: nil
|
175
|
+
I, [2014-04-30T14:38:07.135646 #28778] INFO -- : Initializing backend experella2 at 127.0.0.10:7654 with concurrency 2
|
176
|
+
I, [2014-04-30T14:38:07.135664 #28778] INFO -- : Backend accepts: {"request_url"=>"^((?!/(oneroute|anotherpath)($|/)).)*$", "Host"=>"experella"}
|
177
|
+
I, [2014-04-30T14:38:07.135677 #28778] INFO -- : Backend mangles: nil
|
178
|
+
I, [2014-04-30T14:38:07.135716 #28778] INFO -- : Initializing backend exp proxy at 127.0.0.11:7655 with concurrency 1
|
179
|
+
I, [2014-04-30T14:38:07.135739 #28778] INFO -- : Backend accepts: {"request_url"=>"/(oneroute|anotherpath)($|/)", "Host"=>"experella"}
|
180
|
+
I, [2014-04-30T14:38:07.135753 #28778] INFO -- : Backend mangles: nil
|
181
|
+
I, [2014-04-30T14:38:07.135782 #28778] INFO -- : Initializing backend web at 0.0.0.0:80 with concurrency 1000
|
182
|
+
I, [2014-04-30T14:38:07.135798 #28778] INFO -- : Backend accepts: {"Host"=>"^((?!(experella|127)).)*$"}
|
183
|
+
I, [2014-04-30T14:38:07.135811 #28778] INFO -- : Backend mangles: nil
|
184
|
+
I, [2014-04-30T14:38:07.135928 #28778] INFO -- : Launching experella-proxy at 127.0.0.1:6896 with 6.0s timeout...
|
185
|
+
I, [2014-04-30T14:38:07.135945 #28778] INFO -- : with options: {}
|
186
|
+
I, [2014-04-30T14:38:07.136006 #28778] INFO -- : Launching experella-proxy at 127.0.0.2:7315 with 6.0s timeout...
|
187
|
+
I, [2014-04-30T14:38:07.136021 #28778] INFO -- : with options: {}
|
@@ -2,20 +2,20 @@ require 'logger'
|
|
2
2
|
|
3
3
|
request_part = "oneroute|anotherpath"
|
4
4
|
|
5
|
-
backend(
|
6
|
-
:accepts => {"Host" => "experella", "request_url" => "^((?!/(#{request_part})($|/)).)*$"}
|
5
|
+
backend(:name => "experella1", :host => "127.0.0.10", :port => "7654", :concurrency => "1",
|
6
|
+
:accepts => { "Host" => "experella", "request_url" => "^((?!/(#{request_part})($|/)).)*$" }
|
7
7
|
)
|
8
8
|
|
9
|
-
backend(
|
10
|
-
:accepts => {"Host" => "experella", "request_url" => "^((?!/(#{request_part})($|/)).)*$"}
|
9
|
+
backend(:name => "experella2", :host => "127.0.0.10", :port => "7654", :concurrency => "2",
|
10
|
+
:accepts => { "Host" => "experella", "request_url" => "^((?!/(#{request_part})($|/)).)*$" }
|
11
11
|
)
|
12
12
|
|
13
|
-
backend(
|
14
|
-
:accepts => {"Host" => "experella", "request_url" => "/(#{request_part})($|/)"}
|
13
|
+
backend(:name => "exp proxy", :host => "127.0.0.11", :port => "7655", :concurrency => "1",
|
14
|
+
:accepts => { "Host" => "experella", "request_url" => "/(#{request_part})($|/)" }
|
15
15
|
)
|
16
16
|
|
17
|
-
backend(
|
18
|
-
:accepts => {"Host" => "^((?!(experella|127)).)*$"}
|
17
|
+
backend(:name => "web", :host_port => "0.0.0.0:80", :concurrency => "1000",
|
18
|
+
:accepts => { "Host" => "^((?!(experella|127)).)*$" }
|
19
19
|
)
|
20
20
|
|
21
21
|
# don't forget EM-HTTP-Request (used in experella-proxy specs) default timeout is 10.0
|
@@ -30,5 +30,3 @@ logger.level = Logger::INFO
|
|
30
30
|
|
31
31
|
set_error_pages(404, "404.html")
|
32
32
|
set_error_pages(503, "503.html")
|
33
|
-
|
34
|
-
|
data/spec/spec_helper.rb
CHANGED
@@ -16,20 +16,19 @@ if ENV["COVERAGE"]
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
19
|
require 'pathname'
|
21
20
|
|
22
|
-
LIB_ROOT= Pathname.new(File.dirname(__FILE__) +"/../")
|
23
|
-
RSPEC_ROOT=LIB_ROOT.join("spec")
|
21
|
+
LIB_ROOT = Pathname.new(File.dirname(__FILE__) + "/../")
|
22
|
+
RSPEC_ROOT = LIB_ROOT.join("spec")
|
24
23
|
$: << LIB_ROOT.join("lib")
|
25
24
|
require 'experella-proxy.rb'
|
26
25
|
require 'em-http'
|
27
26
|
require 'posix/spawn'
|
28
27
|
|
29
28
|
# clear spec logfile on startup
|
30
|
-
File.new(File.join(File.expand_path(File.dirname(__FILE__)),"/fixtures/spec.log"), "w+")
|
29
|
+
File.new(File.join(File.expand_path(File.dirname(__FILE__)), "/fixtures/spec.log"), "w+")
|
31
30
|
# load config once before all specs
|
32
|
-
ExperellaProxy::Configuration.new(:configfile => File.join(File.dirname(__FILE__),"/fixtures/test_config.rb"))
|
31
|
+
ExperellaProxy::Configuration.new(:configfile => File.join(File.dirname(__FILE__), "/fixtures/test_config.rb"))
|
33
32
|
|
34
33
|
RSpec.configure do |config|
|
35
34
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
data/test/sinatra/server_one.rb
CHANGED
@@ -3,7 +3,6 @@ require 'sinatra/base'
|
|
3
3
|
# 10kb Testserver
|
4
4
|
#
|
5
5
|
class ServerOne < Sinatra::Base
|
6
|
-
|
7
6
|
get '/' do
|
8
7
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus ultrices, ipsum quis bibendum dignissim, tellus eros placerat nisi, dapibus blandit lectus dui non risus. Integer dui lectus, suscipit non nulla sit amet, iaculis rutrum nulla. Curabitur vehicula in libero facilisis porta. Proin commodo ante nec volutpat hendrerit. Sed dapibus scelerisque aliquet. In hac habitasse platea dictumst. Donec vitae tristique quam. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Phasellus tincidunt eu massa nec aliquam.
|
9
8
|
|
@@ -77,13 +76,11 @@ Nullam congue dolor sed ligula gravida, nec lacinia dui tempus. Duis vitae tempu
|
|
77
76
|
|
78
77
|
Duis fringilla nulla nec euismod consectetur. Maecenas sed turpis arcu. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed auctor augue nec porta hendrerit. Fusce vitae cursus augue. Morbi urna sem, convallis bibendum faucibus ac, tincidunt et nibh. Cras lacinia, lorem eu vestibulum dignissim, ligula nisi consequat erat, eu placerat lacus sem at metus. Cras aliquet urna at nisi volutpat, id tincidunt lacus accumsan.
|
79
78
|
|
80
|
-
Aliquam euismod bibendum mauris. Sed pellentesque, lacus ut sagittis fermentum, diam nibh bibendum metus, ut porttitor libero urna vel sapien. Nunc non urna elementum, volutpat odio vitae, accumsan turpis. Sed pharetra, est non sodales gravida, lacus lacus egestas lacus, a consequat risus libero vitae magna. Sed non molestie felis, in cursus orci.
|
79
|
+
Aliquam euismod bibendum mauris. Sed pellentesque, lacus ut sagittis fermentum, diam nibh bibendum metus, ut porttitor libero urna vel sapien. Nunc non urna elementum, volutpat odio vitae, accumsan turpis. Sed pharetra, est non sodales gravida, lacus lacus egestas lacus, a consequat risus libero vitae magna. Sed non molestie felis, in cursus orci.
|
81
80
|
Sed amet." * 2
|
82
81
|
|
83
82
|
end
|
84
83
|
|
85
|
-
|
86
84
|
# start the server if ruby file executed directly
|
87
85
|
run! if app_file == $0
|
88
|
-
|
89
86
|
end
|