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.
express-loadmill
Advanced tools
Express middleware to enable crowdsourced load simulations via loadmill.com
Users of Loadmill can use this express middleware for:
Using npm:
npm install express-loadmill --save
Using yarn:
yarn add express-loadmill
Use loadmill middleware before everything else (that should be exposed to testing):
var app = require('express')();
var Loadmill = require('express-loadmill');
app.use(Loadmill({verifyToken: process.env.LOADMILL_VERIFY_TOKEN}));
The above code enables both CORS and domain verification. You may optionally disable CORS by setting the enableCors
option to false, e.g.
app.use(Loadmill({enableCors: false, verifyToken: process.env.LOADMILL_VERIFY_TOKEN}));
Note however that you will not be able to perform high-volume load tests with loadmill without enabling CORS.
Domain verification will only be enabled if you supply a verification token, thus the following code will only enable CORS:
app.use(Loadmill());
To enable cookies being sent to and from the server (by setting Access-Control-Allow-Credentials
response header),
set the enableCookies
option to true
, e.g.
app.use(Loadmill({enableCookies: true, verifyToken: process.env.LOADMILL_VERIFY_TOKEN}));
Note that you will also need to enable cookies for your test in the Advanced Settings section of your test configuration.
By enabling performance monitoring, samples of CPU and memory usage of the Node process will be sent to Loadmill (only during load testing) and will be displayed alongside client-side metrics in your performance metrics charts.
The monitoring module is an optional dependency, therefore you must install it. Before installing, make sure you are using Node version v6.1.0 or higher.
Using npm:
npm install express-loadmill loadmill-monitor --save
Using yarn:
yarn add express-loadmill loadmill-monitor
To enable monitoring, you need to configure monitor
options with a personal API token (note this is not the same as verifyToken
):
app.use(Loadmill({
verifyToken: process.env.LOADMILL_VERIFY_TOKEN,
monitor: {
// Required:
apiToken: process.env.LOADMILL_API_TOKEN,
// Default is TRUE:
enabled: process.env.ENABLE_LOADMILL_MONITORING
}
}));
FAQs
Express middleware to enable crowdsourced load simulations via loadmill.com
We found that express-loadmill 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.
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.