Class: AuthProxy::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/auth_proxy/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Proxy

Returns a new instance of Proxy.



3
4
5
6
7
8
9
10
11
# File 'lib/auth_proxy/proxy.rb', line 3

def initialize(options={})
  @app = Rack::ReverseProxy.new do
    reverse_proxy_options preserve_host: true

    options.each do |path, host|
      reverse_proxy path, host, replace_response_host: true
    end
  end
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
# File 'lib/auth_proxy/proxy.rb', line 13

def call(env)
  @app.call(env)
end