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.
delay-proxy
Advanced tools
You may know and use the chrome dev tools and its Network tab where you can emulate slow network connections. The problem is that it applies to all requests, you can't emulate together:
With delay-proxy
, you can proxy your requests specifying a delay and a url.
http://localhost:8001/delay/{delay-in-ms}/{url}
Example calls:
curl http://localhost:8001/delay/1000/https://jsonplaceholder.typicode.com/posts/1/comments
npm install -g delay-proxy
Once that done, you can launch it from anywhere with:
delay-proxy
Available options:
delay-proxy --help
delay-proxy --version
delay-proxy --port 9000
: lets you specify which port you want to use (default: 8001
)You might not like to install the package globally or wanna ship and use this package as a dev dependency in your project:
npm install --save-dev delay-proxy
Run it using npx (an npm package runner shipped with npm since v5.2.0):
npx delay-proxy
delay-proxy
also works as a required module.
const PORT = 8001;
const LOCAL_IP = require("my-local-ip")(); // optional
const { makeServer } = require("delay-proxy");
makeServer({ port: PORT, localIp: LOCAL_IP }).listen(PORT, () =>
console.log(
"delay-proxy now listening on",
`http://localhost:${PORT}`,
`${LOCAL_IP}:${PORT}`
)
);
delay-proxy
if it's already installed: npm uninstall -g delay-proxy
npm link
After that, you can use the delay-proxy
command everywhere.
If your feature/fix isn't about the cli but the server, you don't need to npm link
. Make sure you npm install
then run:
npm run dev
This will launch the server and reload it when you update the source code, thanks to nodemon.
npm run generate-changelog -- v1.1.0 v1.2.0
Christophe Rosset (@topheman) - labs.topheman.com
FAQs
Development server to simulate slow bandwidth
The npm package delay-proxy receives a total of 2 weekly downloads. As such, delay-proxy popularity was classified as not popular.
We found that delay-proxy 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.