https://github.com/bubkoo/global-proxy
Set system proxy for mac and windows platform.
https://github.com/bubkoo/global-proxy
Last synced: about 1 year ago
JSON representation
Set system proxy for mac and windows platform.
- Host: GitHub
- URL: https://github.com/bubkoo/global-proxy
- Owner: bubkoo
- License: mit
- Created: 2016-08-30T15:53:00.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-04-04T14:35:55.000Z (about 6 years ago)
- Last Synced: 2025-04-19T14:58:42.588Z (about 1 year ago)
- Language: TypeScript
- Size: 14.6 KB
- Stars: 14
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# global-proxy
> Set system proxy for mac and windows platform.
[](https://github.com/bubkoo/global-proxy/blob/master/LICENSE)
## Installation
```
$ npm install --save global-proxy
```
## Usage
```js
import globalProxy from 'global-proxy';
// globalProxy.enable(hostname, port[, protocol])
globalProxy.enable('127.0.0.1', 9000, 'http')
.then((stdout) => {
console.log(stdout);
})
.catch((error) => {
console.log(error);
});
globalProxy.disable()
.then((stdout) => {
console.log(stdout);
})
.catch((error) => {
console.log(error);
});
```
## Related
- [global-proxy-cli](https://github.com/bubkoo/global-proxy-cli) - cli for [global-proxy](https://github.com/bubkoo/global-proxy).
## Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please [create an issue](https://github.com/bubkoo/global-proxy/issues/new).