proxy-setup

1.0.3 • Public • Published

proxy-setup

Configure setting of web-proxy. It's available on both script and terminal. Currently, works on Mac and Windows, not Linux. On Mac, need to enter a password of superuser. On Windows, need to restart IE after configuring.

Install

npm install -g proxy-setup

Usage

script

var ps = require('proxy-setup');
 
// set web-proxy
ps.web.server = 'localhost:8080';
ps.web.server = '127.0.0.1';
 
// clear web-proxy
ps.web.server = '';
 
// enable and disable
ps.web.enabled = true;
ps.web.enabled = false;
 
 
// save current setting and restore it
 
console.log(ps.web.enabled) //=> false
console.log(ps.web.server)  //=> ''
 
ps.web.save();
 
ps.web.enabled = true;
ps.web.server = 'temp-server:9999';
 
console.log(ps.web.enabled) //=> true
console.log(ps.web.server)  //=> temp-server:9999
 
ps.web.restore();
 
console.log(ps.web.enabled) //=> false
console.log(ps.web.server)  //=> ''

terminal

# get information current web-proxy 
proxysetup #=> { enabled: true, server: 'localhost:8080' } 
 
# enable web-proxy 
proxysetup -e
 
# disable web-proxy 
proxysetup -d
 
# set web-proxy 
proxysetup -h localhost:8080
proxysetup -h 127.0.0.1
 
# clear web-proxy 
proxysetup -h
 
# set web-proxy and enable 
proxysetup -e -h localhost:8080

Test

npm test

License

Licensed under the MIT license.

Special thanks to

Readme

Keywords

Package Sidebar

Install

npm i proxy-setup

Weekly Downloads

0

Version

1.0.3

License

MIT

Last publish

Collaborators

  • takanopontaro