envoy-proxy 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f046303684c4123875d44395258679379b41ae60
4
- data.tar.gz: e318d631b838ba50ea2cb626c991a962bd39c089
3
+ metadata.gz: 5a83788769ced69f5c313788ccf8e1a8bcca543b
4
+ data.tar.gz: f60bf3a1a99a72e55853ad45c8ae7b6f27138afd
5
5
  SHA512:
6
- metadata.gz: c7cea9a76c8294b8464a423440cb7063a86f1ba01dcb32776ea0398db334508d72b46efc3e7021051936d0c9b6e3b16dfd346a9fa0ca5ba49102bd5fe4bbf525
7
- data.tar.gz: 74a4c7259958459bc27bfdcc2f913455821109468c7c360b7e26021b546d9f3a2740157cc9698145e061377bfa0a2bfd59add3de1451e2bf27f02acb86075e75
6
+ metadata.gz: 587510d3b5f6aa81be04f26b6ae6415560d2feed4fe8073f187ce0a1b2780f5ff90c9e98687fd79433836298d17247bcef7eb97837b80efe0b7d585b915c6793
7
+ data.tar.gz: e2bb1cd839738fa4f789c561a6873806a5f877b77936d006956a420e1b653757c5bccaa89effec47a131a896d6b6ceea4fc9ce23d6593e9f37d1462dce8d1792
@@ -4,13 +4,13 @@ require 'optparse'
4
4
  require 'ostruct'
5
5
 
6
6
  options = {
7
- server_host: 'proxylocal.com',
7
+ server_host: 'p45.eu',
8
8
  server_port: "8282",
9
9
  local_host: '127.0.0.1',
10
10
  local_port: "80",
11
11
  tls: false,
12
12
  verbose: false,
13
- version: "0.3.1"
13
+ version: Envoy::VERSION
14
14
  }
15
15
 
16
16
  OptionParser.new do |op|
@@ -2,7 +2,7 @@ require 'envoy/server/trunk'
2
2
  require 'envoy/server/web'
3
3
  require 'optparse'
4
4
 
5
- listen = []
5
+ listen = ["0.0.0.0", "8080"]
6
6
 
7
7
  OptionParser.new do |op|
8
8
  op.banner = "Usage: #{$0} [options] ZONE"
@@ -14,12 +14,11 @@ OptionParser.new do |op|
14
14
  op.abort "zone required" unless ARGV[0]
15
15
  end
16
16
 
17
- $zone = ARGV[0]
17
+ $zone = ARGV[0].gsub(/^\.+/, '')
18
18
 
19
19
  unless EM.reactor_running?
20
20
  EM.run do
21
21
  EM.start_server "0.0.0.0", 8282, Envoy::Server::Trunk
22
22
  EM.start_server *listen, Envoy::Server::Web
23
23
  end
24
- end
25
-
24
+ end
@@ -18,10 +18,10 @@ module Envoy
18
18
  @header << line + "\r\n"
19
19
  if line =~ /^Host: ([^:]*)/
20
20
  host = $1
21
- raise "Request is not in #{@zone}" unless host.end_with?($zone)
21
+ raise "Request is not in #{$zone}" unless host.end_with?($zone)
22
22
  host = host[0...-$zone.length]
23
23
  host = host.split(".").last
24
- trunk = Trunk.trunks[host].sample || raise("No trunk for #{host}#{$zone}")
24
+ trunk = Trunk.trunks[host].sample || raise("No trunk for #{host}.#{$zone}")
25
25
  @channel = Channel.new(trunk, self, @header)
26
26
  set_text_mode
27
27
  elsif @header.size > 4096
data/lib/envoy/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Envoy
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: envoy-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Baum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-05 00:00:00.000000000 Z
11
+ date: 2013-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.0.0
115
+ rubygems_version: 2.0.3
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: Proxy your local web-server and make it publicly available over the internet