Socket
Socket
Sign inDemoInstall

get-proxy-settings

Package Overview
Dependencies
5
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.8 to 0.1.9

0

dist/cli.d.ts
export {};

@@ -0,0 +0,0 @@ "use strict";

export declare const defaults: {
testUrl: string;
};

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export * from "./defaults";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ProxySetting } from "./proxy-settings";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare enum Protocol {

@@ -0,0 +0,0 @@ "use strict";

1

dist/proxy.d.ts

@@ -11,1 +11,2 @@ import { ProxyCredentials, ProxySettings } from "./proxy-settings";

export declare function getEnvProxy(): ProxySettings;
export declare function parseWindowsProxySetting(proxySetting: string): ProxySettings;

@@ -12,2 +12,3 @@ "use strict";

const npmConfLoader = require("npm-conf");
const url = require("url");
const proxy_errors_1 = require("./proxy-errors");

@@ -95,9 +96,41 @@ const proxy_settings_1 = require("./proxy-settings");

function parseWindowsProxySetting(proxySetting) {
if (!proxySetting) {
return null;
}
if (isValidUrl(proxySetting)) {
const setting = new proxy_settings_1.ProxySetting(proxySetting);
return {
http: setting,
https: setting,
};
}
const settings = proxySetting.split(";").map(x => x.split("=", 2));
const result = {};
for (const [key, value] of settings) {
result[key] = new proxy_settings_1.ProxySetting(value);
if (value) {
result[key] = new proxy_settings_1.ProxySetting(value);
}
}
return result;
return processResults(result);
}
exports.parseWindowsProxySetting = parseWindowsProxySetting;
function isValidUrl(value) {
const obj = url.parse(value);
return Boolean(obj.hostname);
}
function processResults(results) {
const { http, https } = results;
if (http && https) {
return { http, https };
}
else if (http) {
return { http, https: http };
}
else if (https) {
return { http: https, https };
}
else {
return null;
}
}
//# sourceMappingURL=proxy.js.map

@@ -0,0 +0,0 @@ import { ProxySetting } from "./proxy-settings";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ export declare enum Hive {

@@ -0,0 +0,0 @@ "use strict";

2

package.json
{
"name": "get-proxy-settings",
"version": "0.1.8",
"version": "0.1.9",
"description": "Retrieve proxy settings specified by the system",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -0,0 +0,0 @@ # System Proxy

@@ -0,0 +0,0 @@ {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc