Sha256: 8b2100435410dfab06d962ecac4e648473da1f4d0ec59cdd7f20fa494d75d289

Contents?: true

Size: 771 Bytes

Versions: 8

Compression:

Stored size: 771 Bytes

Contents

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

listen = ["0.0.0.0", "8080"]
key = nil

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 "-k", "--key KEY", "Require authentication using KEY" do |v|
    key = v
  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, key
    EM.start_server *listen, Envoy::Server::Web
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
envoy-proxy-0.2.3 lib/envoy/server/command.rb
envoy-proxy-0.2.2 lib/envoy/server/command.rb
envoy-proxy-0.2.0 lib/envoy/server/command.rb
envoy-proxy-0.1.5 lib/envoy/server/command.rb
envoy-proxy-0.1.4 lib/envoy/server/command.rb
envoy-proxy-0.1.3 lib/envoy/server/command.rb
envoy-proxy-0.1.2 lib/envoy/server/command.rb
envoy-proxy-0.1.1 lib/envoy/server/command.rb