![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
node-global-proxy
Advanced tools
Global Proxy for Node.JS with Friendly APIs.
Work with Axios, Request, Got, Superagent etc.
npm install node-global-proxy --save
Basic use with Javascript:
const proxy = require("node-global-proxy").default;
proxy.setConfig("localhost:1080");
proxy.start();
/** Proxy working now! */
proxy.stop();
/** Proxy stop working now! */
Also, you can use a config object
const proxy = require("node-global-proxy").default;
proxy.setConfig({
http: "http://localhost:1080",
https: "https://localhost:1080",
});
proxy.start();
/** Proxy working now! */
proxy.stop();
/** Proxy stop working now! */
Use with typescript or es6+
import proxy from "node-global-rpoxy";
proxy.setConfig("http://localhost:1080");
proxy.start();
proxy.start()
Start using global proxyproxy.stop()
Stop using global proxyproxy.setConfig(config : string | NodeGlobalProxyConfig)
Set config global proxy by url string or config objectproxy.getConfig()
Get current config objectproxy.system()
Get system config and set as node global proxyThis is an example with a proxy server run on localhost:10809
, and get ip information from system proxy, no proxy and user config proxy.
const axios = require('axios');
const proxy = require('node-global-proxy').default;
let PROXY_URL = "localhost:10809"
const test = async () => {
console.log(proxy);
proxy.system();
console.log(proxy.getConfig());
res = await axios.get("http://ip-api.com/json", {
timeout: 3000
});
console.log(res.data);
proxy.setConfig(PROXY_URL);
console.log(proxy.getConfig());
proxy.start();
res = await axios.get("http://ip-api.com/json", {
timeout: 3000
});
console.log(res.data);
proxy.stop();
res = await axios.get("http://ip-api.com/json", {
timeout: 3000
});
console.log(res.data);
proxy.setConfig({
http: "http://" + PROXY_URL,
https: "https://" + PROXY_URL
});
console.log(proxy.getConfig());
proxy.start();
res = await axios.get("http://ip-api.com/json", {
timeout: 3000
});
console.log(res.data);
}
test();
FAQs
A global proxy for Node.JS with friendly API
The npm package node-global-proxy receives a total of 4,444 weekly downloads. As such, node-global-proxy popularity was classified as popular.
We found that node-global-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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.