# `paste.proxy` – Proxy WSGI requests to HTTP requests

An application that proxies WSGI requests to a remote server.

TODO:

- Send `Via` header? It’s not clear to me this is a Via in the style of a typical proxy.

- Other headers or metadata? I put in X-Forwarded-For, but that’s it.

- Signed data of non-HTTP keys? This would be for things like REMOTE_USER.

- Something to indicate what the original URL was? The original host, scheme, and base path.

- Rewriting `Location` headers? mod_proxy does this.

- Rewriting body? (Probably not on this one – that can be done with a different middleware that wraps this middleware)

- Example:

      use = egg:Paste#proxy
      address = http://server3:8680/exist/rest/db/orgs/sch/config/
      allowed_request_methods = GET

## Module Contents

class `paste.proxy.``Proxy`(address, allowed_request_methods=(), suppress_http_headers=())

`paste.proxy.``make_proxy`(global_conf, address, allowed_request_methods='', suppress_http_headers='')

  Make a WSGI application that proxies to another address:

  `address`
    the full URL ending with a trailing `/`
  `allowed_request_methods`:
    a space seperated list of request methods (e.g., `GET POST`)
  `suppress_http_headers`
    a space seperated list of http headers (lower case, without the leading `http_`) that should not be passed on to target host

class `paste.proxy.``TransparentProxy`(force_host=None, force_scheme='http')

  A proxy that sends the request just as it was given, including respecting HTTP_HOST, wsgi.url_scheme, etc.

  This is a way of translating WSGI requests directly to real HTTP requests. All information goes in the environment; modify it to modify the way the request is made.

  If you specify `force_host` (and optionally `force_scheme`) then HTTP_HOST won’t be used to determine where to connect to; instead a specific host will be connected to, but the `Host` header in the request will remain intact.

`paste.proxy.``make_transparent_proxy`(global_conf, force_host=None, force_scheme='http')

  Create a proxy that connects to a specific host, but does absolutely no other filtering, including the Host header.