Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

fastify-https-redirect

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Issues
File Explorer

Advanced tools

fastify-https-redirect

Plugin for fastify to forward http requests to https

    1.0.4latest
    GitHub

Version published
Maintainers
1
Weekly downloads
719
decreased by-3.1%

Weekly downloads

Readme

Source

fastify-https-redirect

A plugin for Fastify that adds support for http => https redirects.

Example

npm install fastify-https-redirect const server = Fastify({ http2: true, https: { allowHTTP1: true, key: fs.readFileSync(path.resolve(__dirname, './yourSSL.key')), cert: fs.readFileSync(path.resolve(__dirname, './yourSSL.cert')), }, }); server.register(httpsRedirect);

With custom http Port

const server = Fastify({ http2: true, https: { allowHTTP1: true, key: fs.readFileSync(path.resolve(__dirname, './yourSSL.key')), cert: fs.readFileSync(path.resolve(__dirname, './yourSSL.cert')), }, }); server.register(httpsRedirect, {httpPort:1080});

With custom http Port and https redirect Port

server.register(httpsRedirect,{httpPort:1080, httpsPort:10443});

License

MIT License

Keywords

FAQs

Last updated on 27 Sep 2021

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc