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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d9b0f4972a7646dbf5c14d62a4dd6b22b38b916
4
- data.tar.gz: d8d329bb6236ff90676eb4b3bd87049e76754d6b
3
+ metadata.gz: 3731648e8dc81bda63ae75d5bd2d7f8bb25d6ba9
4
+ data.tar.gz: 30cf973ba9dc29e8d155b97c0f71a0c2f324b2d4
5
5
  SHA512:
6
- metadata.gz: ba994c1c737f4a6ec79b790bd899615e75a26da0322fe0189cb3ffeeaa46d0598617bfcab2f91df1cdd840ccd7fed06c17f89dddf63d9935260875def10a52ed
7
- data.tar.gz: 906a1e74a93456b3c971b0c15bf398ad79b1213a01a8dd5066cd1d0f0adacdae94d6c4cd18ac52d7010faaf509200d4313d808e00906a51ee32c649263f366b0
6
+ metadata.gz: 219e1ab7b2e51d31baacc8b3bbad3f036bf7091cde633c67a67dc18f68abfa4209fef66a6eceb725ed0a65308067d57df06a0322c8148e3e0fe5d61f7ac43090
7
+ data.tar.gz: 4444bfa29c6e3a56e238c49cd7a377e7d34b25c8e3f9f3b2bd0728e1c6dec0c5e15e6808ddaa282029f7a55b59f7b6be8f65210f84b55f596234a242f99c2a12
@@ -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
@@ -53,9 +53,9 @@ module Envoy
53
53
 
54
54
  def unbind
55
55
  if r = @options[:reconnect]
56
- STDERR.puts "Lost connection. Reconnecting in #{r[0]}s."
57
- EM.add_timer r[0] do
58
- @options[:reconnect] = [r[1], r[0] + r[1]]
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] = [0, 1] if options[:hosts]
73
+ options[:reconnect] = %w"- \\ | /" if options[:hosts]
74
74
  o = options.dup
75
75
  o.delete(:local_host)
76
76
  send_object :options, o
@@ -10,6 +10,10 @@ OptionParser.new do |op|
10
10
  port, host = v.split(":").reverse
11
11
  listen = [host || "0.0.0", port]
12
12
  end
13
+ op.on "--version" do
14
+ puts Envoy::VERSION
15
+ exit
16
+ end
13
17
  op.parse!
14
18
  op.abort "zone required" unless ARGV[0]
15
19
  end
@@ -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"
@@ -1,5 +1,3 @@
1
-
2
1
  module Envoy
3
- VERSION = '0.0.9'
4
- end
5
-
2
+ VERSION = '0.0.10'
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: envoy-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Baum