hrh

hapi-require-https

hapi http -> https redirection for servers behind a reverse proxy

Showing:

Popularity

Downloads/wk

1K

GitHub Stars

43

Maintenance

Last Commit

1yr ago

Contributors

13

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

hapi-require-https tests

hapi plugin that adds http to https redirection

By default, any incoming request with 'http' in X-Forwarded-Proto will be redirected (301) to the same host and path with 'https' as the protocol. You can optionally disable proxy mode and redirect based on the actual request protocol.

Usage

Just register the plugin and go!

server.register({
  plugin: require('hapi-require-https'),
  options: {}
})

API

plugin.register(server, [options])

Registers the plugin to run onRequest in the request lifecycle.

options

Type: object
Default: {}

proxy

Type: boolean
Default: true

Indicates whether the server expects requests coming from a reverse proxy (a common Node web server setup) or directly from the Internet. Set this to false if you'd like to redirect based on the actual protocol instead of the X-Forwarded-Proto header.

License

MIT © Ben Drucker

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial