Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

set-global-proxy

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

set-global-proxy - npm Package Compare versions

Comparing version 0.1.11 to 0.2.0-beta

lib/mac/whistle.jsx

22

index.js
var os = require('os');
var net = require('net');
var fs = require('fs');
var AdmZip = require('adm-zip');
var mac = require('./lib/mac');

@@ -24,2 +26,17 @@ var win = require('./lib/win');

function checkExists() {
if (!fs.existsSync(mac.PROXY_HELPER)) {
return false;
}
return fs.statSync(mac.PROXY_HELPER).size > 0;
}
function initProxyHelper() {
if (!checkExists()) {
var buf = fs.readFileSync(mac.PROXY_HELPER + '.jsx');
var entry = new AdmZip(buf).getEntries()[0];
fs.writeFileSync(mac.PROXY_HELPER, entry.getData());
}
}
// only support mac & win

@@ -31,2 +48,7 @@ function getProxyMgr() {

if (platform === 'darwin') {
try {
initProxyHelper();
} catch (e) {
initProxyHelper();
}
return mac;

@@ -33,0 +55,0 @@ }

5

package.json
{
"name": "set-global-proxy",
"description": "Set global proxy for PC",
"version": "0.1.11",
"version": "0.2.0-beta",
"author": "avenwu <avenwu@vip.qq.com>",

@@ -28,2 +28,5 @@ "contributors": [],

},
"dependencies": {
"adm-zip": "0.5.10"
},
"devDependencies": {

@@ -30,0 +33,0 @@ "babel-core": "^6.7.6",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc