Class: SpellBook::Proxy

Inherits:
Rack::Proxy
  • Object
show all
Defined in:
lib/spellbook/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(port) ⇒ Proxy

Returns a new instance of Proxy.



5
6
7
# File 'lib/spellbook/proxy.rb', line 5

def initialize(port)
  @port = port
end

Instance Method Details

#rewrite_env(env) ⇒ Object



9
10
11
12
13
14
# File 'lib/spellbook/proxy.rb', line 9

def rewrite_env(env)
  env["SERVER_NAME"] = "localhost"
  env["SERVER_PORT"] = @port.to_s
  env["HTTP_HOST"] = "localhost:#{@port}"
  env
end