Gathering detailed insights and metrics for @httptoolkit/httpolyglot
Gathering detailed insights and metrics for @httptoolkit/httpolyglot
Gathering detailed insights and metrics for @httptoolkit/httpolyglot
Gathering detailed insights and metrics for @httptoolkit/httpolyglot
Serve http and https connections over the same port with node.js
npm install @httptoolkit/httpolyglot
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
15 Stars
66 Commits
5 Forks
3 Watching
2 Branches
2 Contributors
Updated on 02 Oct 2024
TypeScript (96.65%)
JavaScript (3.35%)
Cumulative downloads
Total Downloads
Last day
-19.1%
22,458
Compared to previous day
Last week
5.4%
131,062
Compared to previous week
Last month
52.5%
507,378
Compared to previous month
Last year
-22.8%
3,707,574
Compared to previous year
1
7
Part of HTTP Toolkit: powerful tools for building, testing & debugging HTTP(S)
A module for serving HTTP, HTTPS and HTTP/2 connections, all over the same port.
Forked from the original httpolyglot
to fix various issues required for HTTP Toolkit, including:
tlsClientError
: https://github.com/mscdex/httpolyglot/pull/11clientError
events (https://github.com/mscdex/httpolyglot/issues/13)server.on(x, ...)
to hear about x
from all internal servers - HTTP/2, HTTP/1, TLS and net)npm install @httptoolkit/httpolyglot
1const httpolyglot = require('@httptoolkit/httpolyglot'); 2const fs = require('fs'); 3 4httpolyglot.createServer({ 5 key: fs.readFileSync('server.key'), 6 cert: fs.readFileSync('server.crt') 7}, function(req, res) { 8 res.writeHead(200, { 'Content-Type': 'text/plain' }); 9 res.end((req.socket.encrypted ? 'HTTPS' : 'HTTP') + ' Connection!'); 10}).listen(9000, 'localhost', function() { 11 console.log('httpolyglot server listening on port 9000'); 12 // visit http://localhost:9000 and https://localhost:9000 in your browser ... 13});
1const httpolyglot = require('@httptoolkit/httpolyglot'); 2const fs = require('fs'); 3 4httpolyglot.createServer({ 5 key: fs.readFileSync('server.key'), 6 cert: fs.readFileSync('server.crt') 7}, function(req, res) { 8 if (!req.socket.encrypted) { 9 res.writeHead(301, { 'Location': 'https://localhost:9000' }); 10 return res.end(); 11 } 12 res.writeHead(200, { 'Content-Type': 'text/plain' }); 13 res.end('Welcome, HTTPS user!'); 14}).listen(9000, 'localhost', function() { 15 console.log('httpolyglot server listening on port 9000'); 16 // visit http://localhost:9000 and https://localhost:9000 in your browser ... 17});
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.
TLS and HTTP connections are easy to distinguish based on the first byte sent by clients trying to connect. See this comment for more information.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
Found 1/27 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More