Socket
Socket
Sign inDemoInstall

vscode-proxy-agent

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-proxy-agent - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

CHANGELOG.md

13

index.d.ts

@@ -8,11 +8,8 @@ /*---------------------------------------------------------------------------------------------

declare module 'vscode-proxy-agent' {
export declare interface ProxyAgentOptions {
resolveProxy(url: string, callback: (proxy: string) => void): void;
}
export interface ProxyAgentOptions {
resolveProxy(url: string, callback: (proxy: string) => void): void;
}
export class ProxyAgent extends Agent {
constructor(options: ProxyAgentOptions)
}
export declare class ProxyAgent extends Agent {
constructor(options: ProxyAgentOptions)
}

@@ -12,11 +12,8 @@

var net = require('net');
var tls = require('tls');
var http = require('http');
var parse = require('url').parse;
var format = require('url').format;
var Agent = require('agent-base');
var HttpProxyAgent = require('http-proxy-agent');
var HttpsProxyAgent = require('https-proxy-agent');
var SocksProxyAgent = require('socks-proxy-agent');
var inherits = require('util').inherits;
var debug = require('debug')('vscode-proxy-agent');

@@ -39,9 +36,5 @@

Agent.call(this, connect);
this.session = session;
this.cache = this._resolver = null;
this.addRequest = addRequest;
}
inherits(ProxyAgent, Agent);

@@ -54,9 +47,8 @@ /**

function connect (req, opts, fn) {
function addRequest (req, opts) {
var url;
var self = this;
var secure = Boolean(opts.secureEndpoint);
// calculate the `url` parameter
var defaultPort = secure ? 443 : 80;
var defaultAgent = opts._defaultAgent || http.globalAgent;
var path = req.path;

@@ -70,3 +62,3 @@ var firstQuestion = path.indexOf('?');

url = format(Object.assign({}, opts, {
protocol: secure ? 'https:' : 'http:',
protocol: defaultAgent.protocol,
pathname: path,

@@ -80,3 +72,3 @@ search: search,

// set `port` to null when it is the protocol default port (80 / 443)
port: defaultPort == opts.port ? null : opts.port
port: defaultAgent.defaultPort == opts.port ? null : opts.port
}));

@@ -105,9 +97,3 @@

// direct connection to the destination endpoint
var socket;
if (secure) {
socket = tls.connect(opts);
} else {
socket = net.connect(opts);
}
return fn(null, socket);
agent = defaultAgent;
} else if ('SOCKS' == type) {

@@ -121,3 +107,3 @@ // use a SOCKS proxy

var proxy = parse(proxyURL);
if (secure) {
if (defaultAgent.protocol === 'https:') {
agent = new HttpsProxyAgent(proxy);

@@ -129,12 +115,6 @@ } else {

// direct connection to the destination endpoint
var socket;
if (secure) {
socket = tls.connect(opts);
} else {
socket = net.connect(opts);
}
return fn(null, socket);
agent = defaultAgent;
}
if (agent) agent.callback(req, opts, fn);
agent.addRequest(req, opts);
}
}
{
"name": "vscode-proxy-agent",
"version": "0.1.1",
"version": "0.2.0",
"description": "NodeJS http(s) agent implementation for VS Code",

@@ -31,3 +31,2 @@ "main": "index.js",

"dependencies": {
"agent-base": "4.2.1",
"debug": "3.1.0",

@@ -34,0 +33,0 @@ "http-proxy-agent": "2.1.0",

@@ -1,32 +0,20 @@

VS Code Proxy Agent
===============
# VS Code Proxy Agent
Adaption of the [electron-proxy-agent](https://github.com/felicienfrancois/node-electron-proxy-agent) for Visual Studio Code.
License
-------
## Contributing
(The MIT License)
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.microsoft.com.
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
Copyright (c) 2015 Félicien François <felicien@tweakstyle.com>
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## License
[MIT](LICENSE.md)
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