Description
A module for serving HTTP 1.1/2 and HTTPS connections over the same port.
Requirements
- node.js -- v0.12.0 or newer
Install
npm install http2-polyglot
Examples
- Simple usage:
var httpolyglot = ;var fs = ; httpolyglot;
- Simple redirect of all http connections to https:
var httpolyglot = ;var fs = ; httpolyglot;
API
Exports
-
Server - A class similar to https.Server (except instances have
setTimeout()
from http.Server). -
createServer(< object >tlsConfig[, < function >requestListener]) - Server - Creates and returns a new Server instance.
-
protocol - A version string abstracting HTTP/2.