Sha256: f03fdefe94083770dcae0ffd739cc1e2cdf4b5c2268e4a351ff0913b9eead194

Contents?: true

Size: 644 Bytes

Versions: 3

Compression:

Stored size: 644 Bytes

Contents

require 'envoy/server/trunk'
require 'envoy/server/web'
require 'optparse'

listen = ["0.0.0.0", "8080"]

OptionParser.new do |op|
  op.banner = "Usage: #{$0} [options] ZONE"
  op.on "-l", "--listen ADDRESS", "Listen on this [host:]port for HTTP" do |v|
    port, host = v.split(":").reverse
    listen = [host || "0.0.0", port]
  end
  op.on "--version" do
    puts Envoy::VERSION
    exit
  end
  op.parse!
  op.abort "zone required" unless ARGV[0]
end

$zone = ARGV[0].gsub(/^\.+/, '')

unless EM.reactor_running?
  EM.run do
    EM.start_server "0.0.0.0", 8282, Envoy::Server::Trunk
    EM.start_server *listen, Envoy::Server::Web
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
envoy-proxy-0.0.12 lib/envoy/server/command.rb
envoy-proxy-0.0.11 lib/envoy/server/command.rb
envoy-proxy-0.0.10 lib/envoy/server/command.rb