envoy-proxy 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/envoy/server/trunk.rb +9 -11
- data/lib/envoy/utils.rb +8 -3
- data/lib/envoy/version.rb +1 -1
- 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: c19294a78a664f18b65dcecadf00a446f22105d1
|
4
|
+
data.tar.gz: 8a88cf13c94ae2d29c637d955bf2f7e285fd97d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8b114e9db19b449c56a9228d3f1c896559178c23f1e5d072cbda100550393df1800ead876b3008dff45213119c3dbcbeb17ad8304c7f406e9d44d2e8355f5ae
|
7
|
+
data.tar.gz: 7585b58d5b643994d23ea27b00111b0ebcb0e0ff153247a2c444944e1f33347fc6c21e678429c4a5dc342f454bc7a996c33fab1712e4a8ba0d5cc0f47df24eaf
|
data/lib/envoy/server/trunk.rb
CHANGED
@@ -53,6 +53,11 @@ module Envoy
|
|
53
53
|
Gem::Requirement.new(*requirement) =~ Gem::Version.new(@options[:version])
|
54
54
|
end
|
55
55
|
|
56
|
+
def receive_start_tls
|
57
|
+
send_object :start_tls
|
58
|
+
start_tls
|
59
|
+
end
|
60
|
+
|
56
61
|
def receive_pong
|
57
62
|
unless @pinged
|
58
63
|
send_object :ping
|
@@ -71,11 +76,6 @@ module Envoy
|
|
71
76
|
end
|
72
77
|
end
|
73
78
|
|
74
|
-
def receive_start_tls
|
75
|
-
send_object :start_tls
|
76
|
-
start_tls
|
77
|
-
end
|
78
|
-
|
79
79
|
def receive_stream id, data
|
80
80
|
c = channels[id]
|
81
81
|
w = c && c.web
|
@@ -111,12 +111,10 @@ module Envoy
|
|
111
111
|
end && halt
|
112
112
|
if hosts.empty?
|
113
113
|
hosts = [SecureRandom.random_number(36 ** 4).to_s(36)]
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
message Envoy::INFO, "Service accessible at http://#{host}.#{$zone}/"
|
119
|
-
end
|
114
|
+
end
|
115
|
+
@hosts = hosts.each do |host|
|
116
|
+
Trunk.trunks[host] << self
|
117
|
+
message Envoy::INFO, "Service accessible at http://#{host}.#{$zone}/"
|
120
118
|
end
|
121
119
|
unless @options[:key]
|
122
120
|
@options[:key] = SecureRandom.hex(8)
|
data/lib/envoy/utils.rb
CHANGED
@@ -9,16 +9,21 @@ module Envoy
|
|
9
9
|
|
10
10
|
VERBOSITIES = "FEWIDT"
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
def self.verbosity
|
13
|
+
@verbosity
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.verbosity= (num)
|
17
|
+
@verbosity = [0, [5, num].min].max
|
14
18
|
end
|
15
19
|
|
16
20
|
def self.log (level, text, io = STDERR)
|
17
21
|
return unless io
|
22
|
+
level = Envoy.const_get(level.upcase) unless level.is_a?(Numeric)
|
18
23
|
return unless level <= verbosity
|
19
24
|
message = [
|
20
25
|
Time.now.strftime("%F %T"),
|
21
|
-
VERBOSITIES[level]
|
26
|
+
VERBOSITIES[level],
|
22
27
|
text
|
23
28
|
].compact.join(" ")
|
24
29
|
io.puts message
|
data/lib/envoy/version.rb
CHANGED