1.0.1 • Published 8 years ago

x-middleware-proxy v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

x-middleware-proxy

Build Status](https://travis-ci.org/x-component/x-middleware-proxy)

./index.js

./location.js

url

location url reverse rewrite for the location header this uses request.proxy which contains the proxy target config

reverse rewrite example input location url = http://cmsserver:port/prefix/foo/bar;session=XYZ?f=1&b=2 result url shoud be = http://myname:myport/mount/foo/bar;session=ABC?f=1&b=2

./map-cookie.js

extend

this middleware maps the Cookie header for requests and the Set-Cookie header for response the mapping is defined by options

./map-header.js

extend

./map.js

message

level:'debug'

./proxy-forward.js

callback

this middleware prepares the internal proxy request and forwards the intenral proxy response

undefined.request()

Prepares the inner proxy request by creating an object with all related reuqest data.

The existing body of the outer request will be added to the proxy request.

undefined.response()

Forwards the existing inner response, if it is not of content-type html or text. Otherwise statusCode and body of inner response will be stored in the outer response for further transformation.

./proxy-redirect.js

redirect

wrap the original redirect to accept relative urls and automatically produce absolute urls with http server port / complete path

./proxy-status.js

./proxy.js

callback

Returns an function which fires a inner request and puts the data (statusCode','headers','body) from corresponding response to the outer response.

./relativize.js

url

adapt internal absolute urls to relative urls

./relativize2.js

url

adapt internal absolute urls to relative urls

./test/config.js