New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

http2s

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

http2s

HTTP to HTTPS redirection service

2.0.0-1
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

http2s

Redirect HTTP requests to HTTPS

Installation

Install with npm (https://www.npmjs.com/package/http2s)

npm install http2s

Usage

http2s([options,] [callback])

Calls callback(err, activeSettings) on done

CLI usage

Command line usage (requires global install npm install --global http2s)

http2s [httpPort] [hostname]

Listens on http://hostname:httpPort/* and 302 redirects all requests to https://hostname/.

Options

Below options are the default values

var settings = {
  // http port to listen to
  http: 80,
  // https port to redirect to
  https: 443,
  // server hostname to bind http server to
  hostname: 'localhost',
  // automatically redirect
  auto: true,
  // http status code to use for automatic redirect
  redirectStatus: 302,
  // false or '/path/to/page' to redirect all requests to
  singleTarget: false,
  // html message format to print to clients
  message: 'Perhaps you are looking for ' +
           '<a href="%s" target="_self">the HTTPS site</a>?',
  // mime content type to use for message
  messageType: 'text/html',
  // http status code to use when showing message
  messageStatus: 404,
  // error: 0, warn: 1, info: 2, verbose: 3, debug: 4, silly: 5
  logLevel: 2
};

Examples

If you are using port numbers >1000 because of permission issues, listen to that port instead.

http2s({
  hostname: 'localhost',
  http: 8080
});

License

Licensed under Creative Commons CC0 1.0 Universal. All rights waived. See LICENSE for more information.

Disclaimer

Use at own risk.

Keywords

connect

FAQs

Package last updated on 14 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts