Sha256: cf29864ff3adcbb6758c960569a17797823b349b0747eb6b6c6029cc7c47c4d2

Contents?: true

Size: 486 Bytes

Versions: 11

Compression:

Stored size: 486 Bytes

Contents

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.

WARNING: Doesn't work with fakeweb/webmock. Both libraries monkey-patch net/http code.

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rack-proxy-0.5.6 Readme
rack-proxy-0.5.5 Readme
rack-proxy-0.5.4 Readme
rack-proxy-0.5.3 Readme
rack-proxy-0.5.2 Readme
rack-proxy-0.5.1 Readme
rack-proxy-0.5.0 Readme
rack-proxy-0.4.0 Readme
rack-proxy-0.3.7 Readme
rack-proxy-0.3.6 Readme
rack-proxy-0.3.5 Readme