
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
This module exposes two concrete StreamStack implementations:
HttpRequestStack and HttpResponseStack. Together they can be used to write
and/or respond to HTTP requests.
This is an alternative to the built-in core http module. It is designed
to be more lenient, as well as being written with the StreamStack ideology.
In this typical example, we'll establish a net.Stream connection to
www.google.com on port 80 and send an HTTP request for /:
var conn = require('net').createConnection(80, 'www.google.com');
conn.on("connect", function() {
var req = new HttpRequestStack(conn);
// 'response' gets emitted when the HTTP headers have been recieved
req.on("response", function(res) {
console.error(res.headers);
});
// The body of the response will be piped to 'stdout'
req.pipe(process.stdout);
// Initiate a GET request for '/' with no request body
req.get("/", [
"Host: www.google.com"
]);
req.end();
});
Instead, in this example, we'll write() a request to stdout. Don't
expect there to be any response, but it's useful to see what's being written:
var request = new HttpRequestStack(process.stdout);
// Write an HTTP post request to stdout
var body = "hello!\n";
request.post("/", [
"Content-Length: " + body.length,
"Content-Type: text/plain",
"Host: example.com"
]);
request.end(body);
--> POST / HTTP/1.1
--> Content-Length: 7
--> Content-Type: text/plain
--> Host: example.com
-->
--> hello!
You can use HttpResponseStacks to respond to HTTP requests from a net.Server:
require('net').createServer(function(stream) {
var res = new HttpResponseStack(stream);
// 'request' is emitted when HTTP headers from a request have been parsed
res.on("request", function(request) {
res.writeHead(200, [
'Content-Type: text/plain'
]);
res.end('Hello World\n');
});
}).listen(8124, 'localhost');
FAQs
A `StreamStack` implementation of the HTTP protocol.
The npm package http-stack receives a total of 16 weekly downloads. As such, http-stack popularity was classified as not popular.
We found that http-stack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.