Method: Forward::Command::Tunnel#start

Defined in:
lib/forward/command/tunnel.rb

#startObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/forward/command/tunnel.rb', line 14

def start
  print_help_and_exit! if !forwardfile? && @args.empty?

  config.create_or_load
  @options.merge!(DEFAULT_OPTIONS)
  parse_forwardfile
  parse_forwarded

  @options[:subdomain_prefix] = @args[1] if @args.length > 1
  @options[:no_auth]          = @options.fetch(:'no-auth', nil)

  validate :port, :auth, :cname, :subdomain_prefix

  client do
    authenticate_user do
      start_static_server if @options[:static_path]
      open_tunnel
    end
  end
end