Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
http2s
Advanced tools
Readme
Redirect HTTP requests to HTTPS
Install with npm (https://www.npmjs.com/package/http2s)
npm install http2s
http2s([options,] [callback])
Calls callback(err, activeSettings)
on done
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/
.
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
};
If you are using port numbers >1000 because of permission issues, listen to that port instead.
http2s({
hostname: 'localhost',
http: 8080
});
Licensed under Creative Commons CC0 1.0 Universal. All rights waived. See LICENSE for more information.
Use at own risk.
FAQs
HTTP to HTTPS redirection service
We found that http2s demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).