envoy-proxy 0.0.9 → 0.0.10
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 +5 -1
- data/lib/envoy/client/trunk.rb +4 -4
- data/lib/envoy/server/command.rb +4 -0
- data/lib/envoy/server/web.rb +2 -2
- data/lib/envoy/version.rb +2 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3731648e8dc81bda63ae75d5bd2d7f8bb25d6ba9
|
4
|
+
data.tar.gz: 30cf973ba9dc29e8d155b97c0f71a0c2f324b2d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 219e1ab7b2e51d31baacc8b3bbad3f036bf7091cde633c67a67dc18f68abfa4209fef66a6eceb725ed0a65308067d57df06a0322c8148e3e0fe5d61f7ac43090
|
7
|
+
data.tar.gz: 4444bfa29c6e3a56e238c49cd7a377e7d34b25c8e3f9f3b2bd0728e1c6dec0c5e15e6808ddaa282029f7a55b59f7b6be8f65210f84b55f596234a242f99c2a12
|
data/lib/envoy/client/command.rb
CHANGED
@@ -35,6 +35,10 @@ OptionParser.new do |op|
|
|
35
35
|
puts op
|
36
36
|
exit
|
37
37
|
end
|
38
|
+
op.on "--version" do
|
39
|
+
puts Envoy::VERSION
|
40
|
+
exit
|
41
|
+
end
|
38
42
|
op.parse!
|
39
43
|
case ARGV[0]
|
40
44
|
when /^(\d+)$/
|
@@ -51,4 +55,4 @@ unless EM.reactor_running?
|
|
51
55
|
EM.run do
|
52
56
|
Envoy::Client::Trunk.start options
|
53
57
|
end
|
54
|
-
end
|
58
|
+
end
|
data/lib/envoy/client/trunk.rb
CHANGED
@@ -53,9 +53,9 @@ module Envoy
|
|
53
53
|
|
54
54
|
def unbind
|
55
55
|
if r = @options[:reconnect]
|
56
|
-
STDERR.
|
57
|
-
EM.add_timer
|
58
|
-
@options[:reconnect] =
|
56
|
+
STDERR.write "Lost connection. Retrying... #{r[0]}\r"
|
57
|
+
EM.add_timer 0.5 do
|
58
|
+
@options[:reconnect] = r.rotate
|
59
59
|
Trunk.start @options
|
60
60
|
end
|
61
61
|
else
|
@@ -70,7 +70,7 @@ module Envoy
|
|
70
70
|
|
71
71
|
def ssl_handshake_completed
|
72
72
|
options[:did_connect] = true
|
73
|
-
options[:reconnect] =
|
73
|
+
options[:reconnect] = %w"- \\ | /" if options[:hosts]
|
74
74
|
o = options.dup
|
75
75
|
o.delete(:local_host)
|
76
76
|
send_object :options, o
|
data/lib/envoy/server/command.rb
CHANGED
data/lib/envoy/server/web.rb
CHANGED
@@ -19,7 +19,7 @@ module Envoy
|
|
19
19
|
@first_line ||= line
|
20
20
|
if line == ""
|
21
21
|
trunk = Trunk.trunks[@host].sample || raise("No trunk for #{@host}.#{$zone}")
|
22
|
-
@header << "Connection: #{@connection}\r\n"
|
22
|
+
@header << "Connection: #{@connection}\r\n\r\n"
|
23
23
|
@channel = Channel.new(trunk, self, @header)
|
24
24
|
@channel.message "%s %s" % [Socket.unpack_sockaddr_in(get_peername)[1], @first_line]
|
25
25
|
set_text_mode
|
@@ -28,9 +28,9 @@ module Envoy
|
|
28
28
|
elsif line =~ /^keep-alive:/i
|
29
29
|
elsif line =~ /^host:\s*([^:]*)/i
|
30
30
|
@host = $1
|
31
|
+
raise "Request for #{@host} is not in #{$zone}" unless @host.end_with?($zone)
|
31
32
|
@host = @host[0...-$zone.length]
|
32
33
|
@host = @host.split(".").last
|
33
|
-
raise "Request is not in #{$zone}" unless @host.end_with?($zone)
|
34
34
|
@header << line + "\r\n"
|
35
35
|
elsif @header.size > 4096
|
36
36
|
raise "Header's too long for my liking"
|
data/lib/envoy/version.rb
CHANGED