Class: ProxyApp

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/proxy/proxy_app.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proxy_manager = ProxyManager.new) ⇒ ProxyApp

Returns a new instance of ProxyApp.



7
8
9
10
# File 'lib/proxy/proxy_app.rb', line 7

def initialize(proxy_manager = ProxyManager.new)
  @proxy_manager = proxy_manager
  super
end

Class Method Details

.start(options = {}) ⇒ Object



64
65
66
67
68
69
70
71
72
73
# File 'lib/proxy/proxy_app.rb', line 64

def start(options = {})
  require 'thin'
  server = ::Thin::Server.new(
      '0.0.0.0',
      options.fetch(:port, 4985),
      ProxyApp.new
  )

  server.start
end