
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.
toxiproxy-node-client
Advanced tools
Toxiproxy makes it easy and trivial to test network conditions, for example low-bandwidth and high-latency situations. toxiproxy-node-client includes everything needed to get started with configuring Toxiproxy upstream connection and listen endpoints.
The recommended way to install toxiproxy-node-client is through NPM.
Once that is installed and you have added toxiproxy-node-client to your package.json configuration, you can require the package and start using the library.
Here is an example for creating a proxy that limits a Redis connection to 1000KB/s.
// index.js
"use strict";
const toxiproxyClient = require("toxiproxy-node-client");
const toxiproxy = new toxiproxyClient.Toxiproxy("http://localhost:8474");
const proxyBody = {
listen: "localhost:0",
name: "redis",
upstream: "redis:6379"
};
const toxic = toxiproxy.createProxy(proxyBody)
.then((proxy) => {
const toxicBody = {
attributes: { rate: 1000 },
type: "bandwidth"
};
return proxy.addToxic(toxicBody);
});
Here is an example for creating a proxy that limits a Redis connection to 1000KB/s.
// index.ts
import {
Toxiproxy,
ICreateProxyBody,
Toxic, ICreateToxicBody, Bandwidth
} from "toxiproxy-node-client";
const toxiproxy = new Toxiproxy("http://localhost:8474");
const proxyBody = {
listen: "localhost:0",
name: "redis",
upstream: "redis:6379"
};
const proxy = await toxiproxy.createProxy(proxyBody);
const toxicBody = <ICreateToxicBody<T>>{
attributes: <Bandwidth>{ rate: 1000 },
type: "bandwidth"
};
const toxic = proxy.addToxic(toxicBody);
Additional examples can be found in the examples directory for expected usage.
A Toxiproxy instance is needed to run the tests. The easiest way to get one is to use the official Docker image which will make it available on port 8474. The URL (http://localhost:8474) is hard-coded in the tests.
docker run --rm -p 8474:8474 ghcr.io/shopify/toxiproxy:latest
FAQs
Node Client for Toxiproxy
The npm package toxiproxy-node-client receives a total of 16,801 weekly downloads. As such, toxiproxy-node-client popularity was classified as popular.
We found that toxiproxy-node-client 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
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.