lib/envoy/server/trunk.rb in envoy-proxy-1.0.0 vs lib/envoy/server/trunk.rb in envoy-proxy-1.0.1

- old
+ new

@@ -51,10 +51,15 @@ def version? *requirement Gem::Requirement.new(*requirement) =~ Gem::Version.new(@options[:version]) end + def receive_start_tls + send_object :start_tls + start_tls + end + def receive_pong unless @pinged send_object :ping @pinged = true else @@ -69,15 +74,10 @@ chan.web.close(code) channels.delete id end end - def receive_start_tls - send_object :start_tls - start_tls - end - def receive_stream id, data c = channels[id] w = c && c.web w && w.send_data(data) end @@ -109,15 +109,13 @@ end end end && halt if hosts.empty? hosts = [SecureRandom.random_number(36 ** 4).to_s(36)] - message Envoy::INFO, "Service accessible at http://#{hosts[0]}.#{$zone}/" - else - @hosts = hosts.each do |host| - Trunk.trunks[host] << self - message Envoy::INFO, "Service accessible at http://#{host}.#{$zone}/" - end + end + @hosts = hosts.each do |host| + Trunk.trunks[host] << self + message Envoy::INFO, "Service accessible at http://#{host}.#{$zone}/" end unless @options[:key] @options[:key] = SecureRandom.hex(8) message Envoy::INFO, "Service access key is `#{@options[:key]}'" end