Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@allegiant/httpduplex
Advanced tools
Unifies http request and response streams.
There be 🐲 here! The API and functionality are being cemented, anything before a 1.0.0 release is subject to change.
npm install @allegiant/httpduplex
The following example can be found at example/index.js
const fs = require('fs');
const http = require('http');
const httpDuplex = require('@allegiant/httpduplex');
var server = http.createServer(function (req, res) {
var dup = new httpDuplex(req, res);
console.log(dup.method + ' ' + dup.url); // eslint-disable-line
if (dup.url == '/') {
dup.setHeader('content-type', 'text/plain');
if (dup.method === 'POST') {
let size = 0;
dup.on('data', buf => size += buf.length)
.on('end', () => dup.end(size + '\n'));
} else {
fs.createReadStream('README.md').pipe(dup);
}
} else {
dup.setHeader('content-type', 'text/html');
dup.statusCode = 404;
dup.end('Not found');
}
})
.on('listening', function () {
console.log('Listening http://localhost:' + server.address().port + '/'); // eslint-disable-line
})
.listen(7000);
Running the following command will start up a simple http server:
node example/index.js
This began as a compatiblity rewrite of http-duplex.
Copyright © 2017 Allegiant. Distributed under the terms of the MIT License, see LICENSE
0.3.6 (12/28/2017)
FAQs
Unifies http request and response streams.
The npm package @allegiant/httpduplex receives a total of 4 weekly downloads. As such, @allegiant/httpduplex popularity was classified as not popular.
We found that @allegiant/httpduplex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.