1.0.0 • Published 10 years ago

forwarded-host v1.0.0

Weekly downloads
64
License
MIT
Repository
github
Last release
10 years ago

forwarded-host

Determine the URL of the originating request using x-forwarded-host, x-forwarded-port and x-forwarded-proto. Ideal if you are running a service behind a proxy and want to serve up absolute URLs in your response payload.

Installation

The module is released in the npm registry:

npm install --save forwarded-host

Getting started

Include the module in to your application:

'use strict';

var forwarded = require('forwarded-host');

require('http').createServer(function (req, res) {
  var url = forwarded(req);

  res.end('Your url is '+ url);
}).listen(8080);

Run the service behind a proxy and as long as X-Forwarded-Host is sent in the header, the URL should be correct.

1.0.0

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago