Sha256: 49644b3338347ed488f7903096373e90df6efc13f953954dbf497353ff2a7cd0

Contents?: true

Size: 1014 Bytes

Versions: 14

Compression:

Stored size: 1014 Bytes

Contents

#!/usr/bin/env ruby

require 'optparse'
require File.join(File.dirname(__FILE__), '..', 'lib', 'flaky_proxy')

DEFAULTS = {
  :listen_host => 'localhost',
  :listen_port => 8888,
  :target_host => 'localhost',
  :target_port => 8081
}

options = DEFAULTS.dup
parser = OptionParser.new do |opts|
  opts.banner = "Usage: #{$0} [options] [<rules file>]"

  opts.on("-l", "--listen [<HOST>:]<PORT>", "Specify the host and port to listen on") do |listen_spec|
    if listen_spec =~ /^([^:]+):(\d+)$/
      options[:listen_host] = $1
      options[:listen_port] = $2.to_i
    else
      options[:listen_port] = listen_spec.to_i
    end
  end

  opts.on("-t", "--target [<HOST>:]<PORT>", "Specify the host and port to forward to") do |target_spec|
    if target_spec =~ /^([^:]+):(\d+)$/
      options[:target_host] = $1
      options[:target_port] = $2
    else
      options[:target_port] = target_spec.to_i
    end
  end
end
parser.parse!

options[:rules_path] = ARGV[0] if ARGV[0]

FlakyProxy::Proxy.new(options).run

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
newrelic_rpm-3.9.3.241 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.9.2.239 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.9.1.236 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.9.0.229 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.8.1.221 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.8.0.218 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.7.3.204 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.7.3.199 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.7.2.195 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.7.2.192 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.7.2.190.beta test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.7.1.188 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.7.1.182 test/flaky_proxy/script/flaky_proxy
newrelic_rpm-3.7.1.180 test/flaky_proxy/script/flaky_proxy