
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
Server to test http clients. Actually it is old good core [http/https].createServer with few improvements.
Because we need something to test our http-clients, scrapers, bots and so on. On the moment there are three solutions:
This server is easy, handy, tested and don't need more documentation. And it is open to your issues if you need something more.
listen and close methods are promisified, so you can just await them in before-all and after-all sections of tests respectively.mocker creates 'http' server but you may call it with options object and create https server, for example with {key, cert} pair of your choice.npm i mockser
const mocker = require('mocker');
// Creating server
const server = mocker();
// or
// const sslServer = mocker({key, cert});
// Routing (treat it as usual callback for 'request' event but routed to specific path)
server.on('/test', (req, res) => {
res.end('ok');
});
server.on('/404', (req, res) => {
res.statusCode = 404;
res.end('Not Found');
});
// Let it be top-level-await REPL here or do the same inside async function
// Start server
await server.listen(3000);
// Testing
const goodResponse = await httpClient('http://localhost:3000/test'); // 200 - ok
const badResponse = await httpClient('http://localhost:3000/404'); // 404 - Not Found
// Cleanup
await server.close();
See working example in test
MIT
FAQs
Server to test http clients
We found that mockser 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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.