envoy-proxy 0.0.19 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e84778b171d38b9693f61cd2490bec3650f4026
4
- data.tar.gz: a1a0b52a364eec28d5350d419e40b6019b948d16
3
+ metadata.gz: bf7be657a8eebfe9f9d359b317e9fa4359cf557f
4
+ data.tar.gz: 98aadcee405b00fd62e69015c1b234fd6685fb66
5
5
  SHA512:
6
- metadata.gz: e14e3f5d3e6c1757d292cd0af67b385265b2c07446a385a203b13b1e148658a54be532d90f4e57023ad620fa97111cc6da874a9c0befd4209730afa76db880fc
7
- data.tar.gz: c8cf6bb97571ac0bdf8fc3a11e9767eff3a0c10672b802bfa05ca0f5e73cc614beca990520c5579408c304458e83edfaee3ed41d8f390438cc77a9850676cf9a
6
+ metadata.gz: 10516b154822d2676b8a523674dd8f902eaff6d6424fa7b2ea03e8990bb7b73702ebc3a14f4b104e330841bda3ce2bd3af29f5a93ef62782e09911286318fb38
7
+ data.tar.gz: ce814f57891f0a1648d486db5469562e43c5efb7847bec6af3650bcaae30fdd0ce0526811253802bd29e2e87295d3b2ed6a786c11e4c42097225e4d0599934d4
@@ -35,7 +35,7 @@ unless EM.reactor_running?
35
35
  config = config.each_with_object({}) do |(k, v), h|
36
36
  h[k.to_sym] = v
37
37
  end
38
- Envoy::Client::Trunk.start p config
38
+ Envoy::Client::Trunk.start config
39
39
  end
40
40
  end
41
41
  end
@@ -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
- send_object :options, options
85
+ send_object :options, options
82
86
  end
83
87
 
84
88
  def post_init
@@ -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
@@ -1,3 +1,6 @@
1
1
  module Envoy
2
- VERSION = '0.0.19'
2
+ VERSION = '0.1.0'
3
+ def version
4
+ VERSION.split(".")
5
+ end
3
6
  end
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.19
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-07-31 00:00:00.000000000 Z
11
+ date: 2013-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine