mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-07-29 00:59:10 +00:00
optimized tips for global proxy
This commit is contained in:
@@ -18,7 +18,6 @@ function execSync(cmd) {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* proxy for CentOs
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -72,7 +71,7 @@ macProxyManager.getNetworkType = function() {
|
||||
macProxyManager.enableGlobalProxy = function(ip, port, proxyType) {
|
||||
|
||||
if (!ip || !port) {
|
||||
console.log('proxy server\'s ip and port are required');
|
||||
console.log('failed to set global proxy server.\n ip and port are required.');
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -137,12 +136,11 @@ var winProxyManager = {};
|
||||
winProxyManager.enableGlobalProxy = function(ip, port) {
|
||||
|
||||
if (!ip && !port) {
|
||||
console.log('proxy server\'s ip and port are required');
|
||||
console.log('failed to set global proxy server.\n ip and port are required.');
|
||||
return;
|
||||
};
|
||||
|
||||
return execSync(
|
||||
|
||||
// set proxy
|
||||
'reg add "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" /v ProxyServer /t REG_SZ /d ${ip}:${port} /f & '
|
||||
.replace("${ip}", ip)
|
Reference in New Issue
Block a user