GithubHelp home page GithubHelp logo

travi / hapi-require-https Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bendrucker/hapi-require-https

0.0 1.0 0.0 34 KB

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

License: MIT License

JavaScript 100.00%

hapi-require-https's Introduction

hapi-require-https Build Status Greenkeeper badge

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

hapi-require-https's People

Contributors

alex-werner avatar bendrucker avatar briandela avatar greenkeeper[bot] avatar greenkeeperio-bot avatar jgallen23 avatar jsclayton avatar nlindley avatar sauramirez avatar yelworc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.