kage 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.md +8 -0
- data/README.md +1 -1
- data/lib/kage/connection.rb +4 -3
- data/lib/kage/version.rb +1 -1
- metadata +8 -7
data/CHANGES.md
ADDED
data/README.md
CHANGED
@@ -72,7 +72,7 @@ To make `on_backend_finished` callback simpler, if the current request matches w
|
|
72
72
|
```ruby
|
73
73
|
responses = {
|
74
74
|
:original => {:data => "(RAW HTTP response)", :elapsed => 0.1234},
|
75
|
-
:sandbox => {:data => "(RAW HTTP response)", :
|
75
|
+
:sandbox => {:data => "(RAW HTTP response)", :elapsed => 0.2333},
|
76
76
|
}
|
77
77
|
```
|
78
78
|
|
data/lib/kage/connection.rb
CHANGED
@@ -49,7 +49,7 @@ module Kage
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def connect_backends!(req, headers, backends)
|
52
|
-
@backends = select_backends(req, headers).select {|b| backends[b]}
|
52
|
+
@backends = select_backends(req, headers, backends).select {|b| backends[b]}
|
53
53
|
@backends.unshift master_backend unless @backends.include? master_backend
|
54
54
|
info "Backends for #{req[:method]} #{req[:url]} -> #{@backends}"
|
55
55
|
|
@@ -59,8 +59,9 @@ module Kage
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
def select_backends(request, headers)
|
63
|
-
callback(:on_select_backends, request, headers) {
|
62
|
+
def select_backends(request, headers, backends)
|
63
|
+
selected = callback(:on_select_backends, request, headers) { :all }
|
64
|
+
selected == :all ? backends.keys : selected
|
64
65
|
end
|
65
66
|
|
66
67
|
def handle(server)
|
data/lib/kage/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-10-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: em-proxy
|
16
|
-
requirement: &
|
16
|
+
requirement: &70166046140720 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.1.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70166046140720
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: http_parser.rb
|
27
|
-
requirement: &
|
27
|
+
requirement: &70166046140200 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.5.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70166046140200
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70166046139820 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70166046139820
|
47
47
|
description: em-proxy based shadow proxy server
|
48
48
|
email:
|
49
49
|
- miyagawa@bulknews.net
|
@@ -52,6 +52,7 @@ extensions: []
|
|
52
52
|
extra_rdoc_files: []
|
53
53
|
files:
|
54
54
|
- .gitignore
|
55
|
+
- CHANGES.md
|
55
56
|
- Gemfile
|
56
57
|
- LICENSE
|
57
58
|
- README.md
|