lib/envoy/client/command.rb in envoy-proxy-0.1.5 vs lib/envoy/client/command.rb in envoy-proxy-0.2.0

- old
+ new

@@ -31,24 +31,24 @@ end conf["host"] ||= conf["dir"].split("/")[-1] if conf["dir"] conf["dir"] = File.expand_path(conf["dir"], path + "/..") if conf["dir"] end else - [{"local_port" => "80"}] + [{}] end end options = parse_options unless EM.reactor_running? EM.run do load_config.each do |config| - config = options.merge(config) - config["local_port"] ||= rand(16383) + 49152 + config = config.merge(options) + config["local_port"] ||= config["command"] ? rand(16383) + 49152 : 80 config["hosts"] ||= [config.delete("host")] if config["host"] config = config.each_with_object({}) do |(k, v), h| h[k.to_sym] = v end Envoy::Client::Trunk.start config end end -end \ No newline at end of file +end