Class: ReverseTunnel::CLI::Server

Inherits:
Configurator show all
Defined in:
lib/reverse-tunnel/cli.rb

Instance Attribute Summary

Attributes inherited from Base

#arguments

Instance Method Summary collapse

Methods inherited from Configurator

configure, #instance, #method_missing, #parse_host_port, #parse_host_port_range, #server=

Methods inherited from Base

#configure, #initialize, #options

Constructor Details

This class inherits a constructor from ReverseTunnel::CLI::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ReverseTunnel::CLI::Configurator

Instance Method Details

#api=(api) ⇒ Object



129
130
131
# File 'lib/reverse-tunnel/cli.rb', line 129

def api=(api)
  self.api_host, self.api_port = parse_host_port(api)
end

#local=(local) ⇒ Object



133
134
135
# File 'lib/reverse-tunnel/cli.rb', line 133

def local=(local)
  self.local_host, self.local_port_range = parse_host_port_range(local)
end

#parserObject



121
122
123
124
125
126
127
# File 'lib/reverse-tunnel/cli.rb', line 121

def parser
  @parser ||= Trollop::Parser.new do
    opt :server, "Host and port of ReverseTunnel server", :default => "0.0.0.0:4893"
    opt :api, "Host and port of ReverseTunnel HTTP api", :default => "127.0.0.1:4894"
    opt :local, "Host and port range to listen forwarded connections", :default => "127.0.0.1:10000-10010"
  end
end