Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A simple node.js script that turns a single-threaded server into a multi-threaded server with automatic restarting.
A simple node.js script that turns a simple single-process server into a multi-process cluster'd server with automatic restarting.
Plays nice with Express and similar libraries.
npm install --save gatlin
Instead of calling node server.js
call npx gatling server.js
. It will start one manager process + one worker process for each logical CPU core.
package.json
Add a scripts.start
entry like so:
{
//...
"scripts": {
"start": "gatling app.js"
}
}
This was the only option in v1, and is preserved for backwards-compatibility.
Instead of starting the server, simply export the handler function and then call gatlin with the path to your server.js
or app.js
.
(The reason this was needed is that Gatlin ran each request inside a domain in v1. It prevented errors in one request from interfering with any other requests, but the API has since been deprecated.)
Just change
app.listen(port)
to
module.exports = app;
Your app should export the function that gets passed to http.createServer
and not create the server itself.
For example, say your app.js
looks like this:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337);
Change it to this:
module.exports = function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
});
To start your server, run npm start
. Or, to call gatling directly, run ./node_modules/bin/gatling app.js
The following command line options are accepted
-q
, --quiet
: silences all non-error output
--processes 2
: Set the number of worker processes. Defaults to one per CPU core.
-p 1234
, --port 1234
: defaults to the PORT
or VCAP_APP_PORT
(bluemix) environment properties, or 8080 if not set. (Only applies when gatling starts the server rathern than your app.)
listen()
themselvesFAQs
A simple node.js script that turns a single-threaded server into a multi-threaded server with automatic restarting.
The npm package gatling receives a total of 124 weekly downloads. As such, gatling popularity was classified as not popular.
We found that gatling 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.