net-proxied: Set up proxy for operating systems
Supported
- Windows operating system
- Mac operating system
- Linux operating system (KDE,GNOME)
Install
npm i net-proxied
Example
Set up proxy on Windows:
import { WindowsProxied, WindowsProxyConfig } from "net-proxied";
const config: WindowsProxyConfig = {
hostname: "10.20.30.40",
port: 5060,
types: ["http", "https", "ftp"],
override: ["localhost", "192.168.*", "10.*"]
};
WindowsProxied.enable(config);
// You can also disable it
// WindowsProxied.disable();
Set up proxy on Mac:
import { MacProxied, MacProxyConfig } from "net-proxied";
const config: MacProxyConfig = {
hostname: "10.20.30.40",
port: 5060,
networkServiceNames: ["Ethernet"],
types: ["web", "secureweb", "ftp"],
passDomains: ["localhost", "192.168.*", "10.*"]
};
MacProxied.enable(config);
// You can also disable it
// MacProxied.disable();
Set up proxy on Linux:
import { Authentication, BaseProxyConfig, LinuxProxied, LinuxProxyConfig } from "net-proxied";
const baseProxy: BaseProxyConfig = {
hostname: "10.20.30.40",
port: 5060
};
const authentication: Authentication = {
username: "username",
password: "password"
};
const config: LinuxProxyConfig = {
http: baseProxy,
https: baseProxy,
ftp: baseProxy,
socks: baseProxy,
noProxy: ["localhost", "192.168.*", "10.*"],
authentication: authentication
};
LinuxProxied.enable(config);
// You can also disable it
// LinuxProxied.disable();