Skip to content
forked from ncr/rack-proxy

A request/response rewriting HTTP proxy. A Rack app.

Notifications You must be signed in to change notification settings

scottley/rack-proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A request/response rewriting HTTP proxy. A Rack app.

Subclass Rack::Proxy and provide your rewrite_env and rewrite_response methods.

Example:

class Foo < Rack::Proxy

  def rewrite_env(env)
    env["HTTP_HOST"] = "example.com"

    env
  end

  def rewrite_response(triplet)
    status, headers, body = triplet

    headers["X-Foo"] = "Bar"

    triplet
  end

end

See tests for more examples.

About

A request/response rewriting HTTP proxy. A Rack app.

Resources

Stars

Watchers

Forks

Packages

No packages published