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.
get-proxy-settings
Advanced tools
Note: This project is not actively maintained. If some issues come up we'll look into fixing them but new features will most likely not make it.
This library support
HTTP_PROXY
or HTTPS_PROXY
environment variablesHTTP_PROXY
or HTTPS_PROXY
node configurationnpm install --save get-proxy-settings
Import
// With named import
import { getProxySettings, getAndTestProxySettings } from "get-proxy-settings";
// Or with commonjs
const { getProxySettings, getAndTestProxySettings } = require("get-proxy-settings");
Use
async function basic() {
const proxy = await getProxySettings();
console.log("proxy", proxy.http, proxy.https);
}
// Get and validate the proxy settings
async function withValidation() {
async function login() {
// Do any async operation to retrieve the username and password of the user(prompt?)
return {username: "abc", password: "123"}
}
const proxy = await getAndTestProxySettings(login);
console.log("proxy", proxy.http, proxy.https);
}
Update the test url (Which url is used to validate the proxy)
import { defaults } from "get-proxy-settings";
defaults.testUrl = "https://example.com";
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
FAQs
Retrieve proxy settings specified by the system
We found that get-proxy-settings demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.