Class: XProxy::Application
- Inherits:
-
Object
- Object
- XProxy::Application
- Defined in:
- lib/xproxy/application.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(host, headers) ⇒ Application
constructor
A new instance of Application.
Constructor Details
#initialize(host, headers) ⇒ Application
Returns a new instance of Application.
6 7 8 |
# File 'lib/xproxy/application.rb', line 6 def initialize(host, headers) @host, @headers = host, headers end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/xproxy/application.rb', line 10 def call(env) host, headers = @host, @headers app = Rack::Builder.new do use Rack::Header, headers run Rack::Proxy.new(host) end app.call(env) end |