envoy-proxy 0.0.7 → 0.0.8
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 -2
- data/lib/envoy/client/trunk.rb +21 -3
- data/lib/envoy/version.rb +1 -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: ef2118712910e35819c817d33c0e2d6b7f9d502b
|
4
|
+
data.tar.gz: 88ae6105ccd8b45c4c21b2ca5f3550eaec77de9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f37e81842ec29acd108aa83d71f9d0a8b802d8b5e47cc914a2b134110b525c133aeecdad66ad530a13a7210b32f8ec9fed8f28e6f0b52f9ee751d04369d19e70
|
7
|
+
data.tar.gz: 57e5090d881c0d67b267114332cb8a9665f1c22a2e8e2f98dbf06610f475b9ae8313169367caeb826b5723991e0ff7ef5f9fec6d21a8639210a1769eb8667ce7
|
data/lib/envoy/client/command.rb
CHANGED
data/lib/envoy/client/trunk.rb
CHANGED
@@ -9,6 +9,10 @@ module Envoy
|
|
9
9
|
|
10
10
|
attr_reader :options
|
11
11
|
|
12
|
+
def self.start options
|
13
|
+
EM.connect options[:server_host], options[:server_port].to_i, Envoy::Client::Trunk, options
|
14
|
+
end
|
15
|
+
|
12
16
|
def initialize options
|
13
17
|
@options = options
|
14
18
|
end
|
@@ -47,10 +51,25 @@ module Envoy
|
|
47
51
|
end
|
48
52
|
|
49
53
|
def unbind
|
50
|
-
|
54
|
+
if @options[:reconnect]
|
55
|
+
STDERR.puts "No connection. Reconnecting in #{@options[:reconnect]}s."
|
56
|
+
EM.add_timer @options[:reconnect] do
|
57
|
+
@options[:reconnect] *= 2
|
58
|
+
Trunk.start @options
|
59
|
+
end
|
60
|
+
else
|
61
|
+
if options[:did_connect]
|
62
|
+
STDERR.puts "Connection lost. Not point reconnecting because the host is randomly generated."
|
63
|
+
else
|
64
|
+
STDERR.puts "Couldn't connect. Abandoning ship."
|
65
|
+
end
|
66
|
+
receive_halt
|
67
|
+
end
|
51
68
|
end
|
52
69
|
|
53
70
|
def ssl_handshake_completed
|
71
|
+
options[:did_connect] = true
|
72
|
+
options[:reconnect] = 1 if options[:hosts]
|
54
73
|
o = options.dup
|
55
74
|
o.delete(:local_host)
|
56
75
|
send_object :options, o
|
@@ -63,5 +82,4 @@ module Envoy
|
|
63
82
|
end
|
64
83
|
|
65
84
|
end
|
66
|
-
end
|
67
|
-
|
85
|
+
end
|
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.0.8
|
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-05-
|
11
|
+
date: 2013-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|