envoy-proxy 0.0.19 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/envoy/client/command.rb +1 -1
- data/lib/envoy/client/trunk.rb +5 -1
- data/lib/envoy/server/trunk.rb +17 -1
- data/lib/envoy/version.rb +4 -1
- 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: bf7be657a8eebfe9f9d359b317e9fa4359cf557f
|
4
|
+
data.tar.gz: 98aadcee405b00fd62e69015c1b234fd6685fb66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10516b154822d2676b8a523674dd8f902eaff6d6424fa7b2ea03e8990bb7b73702ebc3a14f4b104e330841bda3ce2bd3af29f5a93ef62782e09911286318fb38
|
7
|
+
data.tar.gz: ce814f57891f0a1648d486db5469562e43c5efb7847bec6af3650bcaae30fdd0ce0526811253802bd29e2e87295d3b2ed6a786c11e4c42097225e4d0599934d4
|
data/lib/envoy/client/command.rb
CHANGED
data/lib/envoy/client/trunk.rb
CHANGED
@@ -51,6 +51,10 @@ module Envoy
|
|
51
51
|
log message
|
52
52
|
end
|
53
53
|
|
54
|
+
def receive_ping
|
55
|
+
send_object :pong
|
56
|
+
end
|
57
|
+
|
54
58
|
def receive_halt
|
55
59
|
@halting = true
|
56
60
|
EventMachine.stop_event_loop
|
@@ -78,7 +82,7 @@ module Envoy
|
|
78
82
|
def ssl_handshake_completed
|
79
83
|
options[:did_connect] = true
|
80
84
|
options[:reconnect] = %w"- \\ | /" if options[:hosts]
|
81
|
-
|
85
|
+
send_object :options, options
|
82
86
|
end
|
83
87
|
|
84
88
|
def post_init
|
data/lib/envoy/server/trunk.rb
CHANGED
@@ -14,6 +14,10 @@ module Envoy
|
|
14
14
|
@trunks ||= Hash.new{|h,k|h[k] = []}
|
15
15
|
end
|
16
16
|
|
17
|
+
def post_init
|
18
|
+
self.comm_inactivity_timeout = 25
|
19
|
+
end
|
20
|
+
|
17
21
|
def hosts
|
18
22
|
@hosts ||= []
|
19
23
|
end
|
@@ -22,6 +26,9 @@ module Envoy
|
|
22
26
|
@channels ||= {}
|
23
27
|
end
|
24
28
|
|
29
|
+
def receive_pong
|
30
|
+
end
|
31
|
+
|
25
32
|
def receive_close id, code = nil
|
26
33
|
if chan = channels[id]
|
27
34
|
chan.web.close(code)
|
@@ -52,6 +59,15 @@ module Envoy
|
|
52
59
|
|
53
60
|
def receive_options options
|
54
61
|
@options = options
|
62
|
+
if (@options[:version].split(".").map(&:to_i) <=> [0, 1, 0]) > -1
|
63
|
+
EM.add_periodic_timer 5 do
|
64
|
+
send_object :ping
|
65
|
+
end
|
66
|
+
else
|
67
|
+
EM.add_periodic_timer 20 do
|
68
|
+
send_object :message, "Checking client is still here. Upgrade to hide this message."
|
69
|
+
end
|
70
|
+
end
|
55
71
|
if @key and @key != @options[:key]
|
56
72
|
halt "Key is invalid"
|
57
73
|
return
|
@@ -81,7 +97,7 @@ module Envoy
|
|
81
97
|
unless @options[:key]
|
82
98
|
@options[:key] ||= SecureRandom.hex(8)
|
83
99
|
send_object :message, "Your key is #{@options[:key]}"
|
84
|
-
end
|
100
|
+
end
|
85
101
|
end
|
86
102
|
|
87
103
|
def unbind
|
data/lib/envoy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envoy-proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Baum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|