mirror of
				https://github.com/musix-org/musix-oss
				synced 2025-11-04 09:49:32 +00:00 
			
		
		
		
	Modules
This commit is contained in:
		
							
								
								
									
										145
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										145
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,145 @@
 | 
			
		||||
agent-base
 | 
			
		||||
==========
 | 
			
		||||
### Turn a function into an [`http.Agent`][http.Agent] instance
 | 
			
		||||
[](https://github.com/TooTallNate/node-agent-base/actions?workflow=Node+CI)
 | 
			
		||||
 | 
			
		||||
This module provides an `http.Agent` generator. That is, you pass it an async
 | 
			
		||||
callback function, and it returns a new `http.Agent` instance that will invoke the
 | 
			
		||||
given callback function when sending outbound HTTP requests.
 | 
			
		||||
 | 
			
		||||
#### Some subclasses:
 | 
			
		||||
 | 
			
		||||
Here's some more interesting uses of `agent-base`.
 | 
			
		||||
Send a pull request to list yours!
 | 
			
		||||
 | 
			
		||||
 * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints
 | 
			
		||||
 * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints
 | 
			
		||||
 * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS
 | 
			
		||||
 * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS (v4a) proxy `http.Agent` implementation for HTTP and HTTPS
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Installation
 | 
			
		||||
------------
 | 
			
		||||
 | 
			
		||||
Install with `npm`:
 | 
			
		||||
 | 
			
		||||
``` bash
 | 
			
		||||
$ npm install agent-base
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Example
 | 
			
		||||
-------
 | 
			
		||||
 | 
			
		||||
Here's a minimal example that creates a new `net.Socket` connection to the server
 | 
			
		||||
for every HTTP request (i.e. the equivalent of `agent: false` option):
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
var net = require('net');
 | 
			
		||||
var tls = require('tls');
 | 
			
		||||
var url = require('url');
 | 
			
		||||
var http = require('http');
 | 
			
		||||
var agent = require('agent-base');
 | 
			
		||||
 | 
			
		||||
var endpoint = 'http://nodejs.org/api/';
 | 
			
		||||
var parsed = url.parse(endpoint);
 | 
			
		||||
 | 
			
		||||
// This is the important part!
 | 
			
		||||
parsed.agent = agent(function (req, opts) {
 | 
			
		||||
  var socket;
 | 
			
		||||
  // `secureEndpoint` is true when using the https module
 | 
			
		||||
  if (opts.secureEndpoint) {
 | 
			
		||||
    socket = tls.connect(opts);
 | 
			
		||||
  } else {
 | 
			
		||||
    socket = net.connect(opts);
 | 
			
		||||
  }
 | 
			
		||||
  return socket;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// Everything else works just like normal...
 | 
			
		||||
http.get(parsed, function (res) {
 | 
			
		||||
  console.log('"response" event!', res.headers);
 | 
			
		||||
  res.pipe(process.stdout);
 | 
			
		||||
});
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Returning a Promise or using an `async` function is also supported:
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
agent(async function (req, opts) {
 | 
			
		||||
  await sleep(1000);
 | 
			
		||||
  // etc…
 | 
			
		||||
});
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Return another `http.Agent` instance to "pass through" the responsibility
 | 
			
		||||
for that HTTP request to that agent:
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
agent(function (req, opts) {
 | 
			
		||||
  return opts.secureEndpoint ? https.globalAgent : http.globalAgent;
 | 
			
		||||
});
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## Agent(Function callback[, Object options]) → [http.Agent][]
 | 
			
		||||
 | 
			
		||||
Creates a base `http.Agent` that will execute the callback function `callback`
 | 
			
		||||
for every HTTP request that it is used as the `agent` for. The callback function
 | 
			
		||||
is responsible for creating a `stream.Duplex` instance of some kind that will be
 | 
			
		||||
used as the underlying socket in the HTTP request.
 | 
			
		||||
 | 
			
		||||
The `options` object accepts the following properties:
 | 
			
		||||
 | 
			
		||||
  * `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional).
 | 
			
		||||
 | 
			
		||||
The callback function should have the following signature:
 | 
			
		||||
 | 
			
		||||
### callback(http.ClientRequest req, Object options, Function cb) → undefined
 | 
			
		||||
 | 
			
		||||
The ClientRequest `req` can be accessed to read request headers and
 | 
			
		||||
and the path, etc. The `options` object contains the options passed
 | 
			
		||||
to the `http.request()`/`https.request()` function call, and is formatted
 | 
			
		||||
to be directly passed to `net.connect()`/`tls.connect()`, or however
 | 
			
		||||
else you want a Socket to be created. Pass the created socket to
 | 
			
		||||
the callback function `cb` once created, and the HTTP request will
 | 
			
		||||
continue to proceed.
 | 
			
		||||
 | 
			
		||||
If the `https` module is used to invoke the HTTP request, then the
 | 
			
		||||
`secureEndpoint` property on `options` _will be set to `true`_.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
License
 | 
			
		||||
-------
 | 
			
		||||
 | 
			
		||||
(The MIT License)
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
 | 
			
		||||
 | 
			
		||||
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:
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent
 | 
			
		||||
[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
 | 
			
		||||
[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent
 | 
			
		||||
[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
 | 
			
		||||
[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent
 | 
			
		||||
							
								
								
									
										73
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/index.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/index.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,73 @@
 | 
			
		||||
/// <reference types="node" />
 | 
			
		||||
import net from 'net';
 | 
			
		||||
import http from 'http';
 | 
			
		||||
import https from 'https';
 | 
			
		||||
import { Duplex } from 'stream';
 | 
			
		||||
import { EventEmitter } from 'events';
 | 
			
		||||
declare function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent;
 | 
			
		||||
declare function createAgent(callback: createAgent.AgentCallback, opts?: createAgent.AgentOptions): createAgent.Agent;
 | 
			
		||||
declare namespace createAgent {
 | 
			
		||||
    interface ClientRequest extends http.ClientRequest {
 | 
			
		||||
        _last?: boolean;
 | 
			
		||||
        _hadError?: boolean;
 | 
			
		||||
        method: string;
 | 
			
		||||
    }
 | 
			
		||||
    interface AgentRequestOptions {
 | 
			
		||||
        host?: string;
 | 
			
		||||
        path?: string;
 | 
			
		||||
        port: number;
 | 
			
		||||
    }
 | 
			
		||||
    interface HttpRequestOptions extends AgentRequestOptions, Omit<http.RequestOptions, keyof AgentRequestOptions> {
 | 
			
		||||
        secureEndpoint: false;
 | 
			
		||||
    }
 | 
			
		||||
    interface HttpsRequestOptions extends AgentRequestOptions, Omit<https.RequestOptions, keyof AgentRequestOptions> {
 | 
			
		||||
        secureEndpoint: true;
 | 
			
		||||
    }
 | 
			
		||||
    type RequestOptions = HttpRequestOptions | HttpsRequestOptions;
 | 
			
		||||
    type AgentLike = Pick<createAgent.Agent, 'addRequest'> | http.Agent;
 | 
			
		||||
    type AgentCallbackReturn = Duplex | AgentLike;
 | 
			
		||||
    type AgentCallbackCallback = (err: Error | null | undefined, socket: createAgent.AgentCallbackReturn) => void;
 | 
			
		||||
    type AgentCallbackPromise = (req: createAgent.ClientRequest, opts: createAgent.RequestOptions) => createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>;
 | 
			
		||||
    type AgentCallback = typeof Agent.prototype.callback;
 | 
			
		||||
    type AgentOptions = {
 | 
			
		||||
        timeout?: number;
 | 
			
		||||
    };
 | 
			
		||||
    /**
 | 
			
		||||
     * Base `http.Agent` implementation.
 | 
			
		||||
     * No pooling/keep-alive is implemented by default.
 | 
			
		||||
     *
 | 
			
		||||
     * @param {Function} callback
 | 
			
		||||
     * @api public
 | 
			
		||||
     */
 | 
			
		||||
    class Agent extends EventEmitter {
 | 
			
		||||
        timeout: number | null;
 | 
			
		||||
        maxFreeSockets: number;
 | 
			
		||||
        maxSockets: number;
 | 
			
		||||
        sockets: {
 | 
			
		||||
            [key: string]: net.Socket[];
 | 
			
		||||
        };
 | 
			
		||||
        requests: {
 | 
			
		||||
            [key: string]: http.IncomingMessage[];
 | 
			
		||||
        };
 | 
			
		||||
        private promisifiedCallback?;
 | 
			
		||||
        private explicitDefaultPort?;
 | 
			
		||||
        private explicitProtocol?;
 | 
			
		||||
        constructor(callback?: createAgent.AgentCallback | createAgent.AgentOptions, _opts?: createAgent.AgentOptions);
 | 
			
		||||
        get defaultPort(): number;
 | 
			
		||||
        set defaultPort(v: number);
 | 
			
		||||
        get protocol(): string;
 | 
			
		||||
        set protocol(v: string);
 | 
			
		||||
        callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions, fn: createAgent.AgentCallbackCallback): void;
 | 
			
		||||
        callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions): createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>;
 | 
			
		||||
        /**
 | 
			
		||||
         * Called by node-core's "_http_client.js" module when creating
 | 
			
		||||
         * a new HTTP request with this Agent instance.
 | 
			
		||||
         *
 | 
			
		||||
         * @api public
 | 
			
		||||
         */
 | 
			
		||||
        addRequest(req: ClientRequest, _opts: RequestOptions): void;
 | 
			
		||||
        freeSocket(socket: net.Socket, opts: AgentOptions): void;
 | 
			
		||||
        destroy(): void;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
export = createAgent;
 | 
			
		||||
							
								
								
									
										200
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										200
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,200 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
var __importDefault = (this && this.__importDefault) || function (mod) {
 | 
			
		||||
    return (mod && mod.__esModule) ? mod : { "default": mod };
 | 
			
		||||
};
 | 
			
		||||
const events_1 = require("events");
 | 
			
		||||
const debug_1 = __importDefault(require("debug"));
 | 
			
		||||
const promisify_1 = __importDefault(require("./promisify"));
 | 
			
		||||
const debug = debug_1.default('agent-base');
 | 
			
		||||
function isAgent(v) {
 | 
			
		||||
    return Boolean(v) && typeof v.addRequest === 'function';
 | 
			
		||||
}
 | 
			
		||||
function isSecureEndpoint() {
 | 
			
		||||
    const { stack } = new Error();
 | 
			
		||||
    if (typeof stack !== 'string')
 | 
			
		||||
        return false;
 | 
			
		||||
    return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1);
 | 
			
		||||
}
 | 
			
		||||
function createAgent(callback, opts) {
 | 
			
		||||
    return new createAgent.Agent(callback, opts);
 | 
			
		||||
}
 | 
			
		||||
(function (createAgent) {
 | 
			
		||||
    /**
 | 
			
		||||
     * Base `http.Agent` implementation.
 | 
			
		||||
     * No pooling/keep-alive is implemented by default.
 | 
			
		||||
     *
 | 
			
		||||
     * @param {Function} callback
 | 
			
		||||
     * @api public
 | 
			
		||||
     */
 | 
			
		||||
    class Agent extends events_1.EventEmitter {
 | 
			
		||||
        constructor(callback, _opts) {
 | 
			
		||||
            super();
 | 
			
		||||
            let opts = _opts;
 | 
			
		||||
            if (typeof callback === 'function') {
 | 
			
		||||
                this.callback = callback;
 | 
			
		||||
            }
 | 
			
		||||
            else if (callback) {
 | 
			
		||||
                opts = callback;
 | 
			
		||||
            }
 | 
			
		||||
            // Timeout for the socket to be returned from the callback
 | 
			
		||||
            this.timeout = null;
 | 
			
		||||
            if (opts && typeof opts.timeout === 'number') {
 | 
			
		||||
                this.timeout = opts.timeout;
 | 
			
		||||
            }
 | 
			
		||||
            // These aren't actually used by `agent-base`, but are required
 | 
			
		||||
            // for the TypeScript definition files in `@types/node` :/
 | 
			
		||||
            this.maxFreeSockets = 1;
 | 
			
		||||
            this.maxSockets = 1;
 | 
			
		||||
            this.sockets = {};
 | 
			
		||||
            this.requests = {};
 | 
			
		||||
        }
 | 
			
		||||
        get defaultPort() {
 | 
			
		||||
            if (typeof this.explicitDefaultPort === 'number') {
 | 
			
		||||
                return this.explicitDefaultPort;
 | 
			
		||||
            }
 | 
			
		||||
            return isSecureEndpoint() ? 443 : 80;
 | 
			
		||||
        }
 | 
			
		||||
        set defaultPort(v) {
 | 
			
		||||
            this.explicitDefaultPort = v;
 | 
			
		||||
        }
 | 
			
		||||
        get protocol() {
 | 
			
		||||
            if (typeof this.explicitProtocol === 'string') {
 | 
			
		||||
                return this.explicitProtocol;
 | 
			
		||||
            }
 | 
			
		||||
            return isSecureEndpoint() ? 'https:' : 'http:';
 | 
			
		||||
        }
 | 
			
		||||
        set protocol(v) {
 | 
			
		||||
            this.explicitProtocol = v;
 | 
			
		||||
        }
 | 
			
		||||
        callback(req, opts, fn) {
 | 
			
		||||
            throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
 | 
			
		||||
        }
 | 
			
		||||
        /**
 | 
			
		||||
         * Called by node-core's "_http_client.js" module when creating
 | 
			
		||||
         * a new HTTP request with this Agent instance.
 | 
			
		||||
         *
 | 
			
		||||
         * @api public
 | 
			
		||||
         */
 | 
			
		||||
        addRequest(req, _opts) {
 | 
			
		||||
            const opts = Object.assign({}, _opts);
 | 
			
		||||
            if (typeof opts.secureEndpoint !== 'boolean') {
 | 
			
		||||
                opts.secureEndpoint = isSecureEndpoint();
 | 
			
		||||
            }
 | 
			
		||||
            if (opts.host == null) {
 | 
			
		||||
                opts.host = 'localhost';
 | 
			
		||||
            }
 | 
			
		||||
            if (opts.port == null) {
 | 
			
		||||
                opts.port = opts.secureEndpoint ? 443 : 80;
 | 
			
		||||
            }
 | 
			
		||||
            if (opts.protocol == null) {
 | 
			
		||||
                opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';
 | 
			
		||||
            }
 | 
			
		||||
            if (opts.host && opts.path) {
 | 
			
		||||
                // If both a `host` and `path` are specified then it's most
 | 
			
		||||
                // likely the result of a `url.parse()` call... we need to
 | 
			
		||||
                // remove the `path` portion so that `net.connect()` doesn't
 | 
			
		||||
                // attempt to open that as a unix socket file.
 | 
			
		||||
                delete opts.path;
 | 
			
		||||
            }
 | 
			
		||||
            delete opts.agent;
 | 
			
		||||
            delete opts.hostname;
 | 
			
		||||
            delete opts._defaultAgent;
 | 
			
		||||
            delete opts.defaultPort;
 | 
			
		||||
            delete opts.createConnection;
 | 
			
		||||
            // Hint to use "Connection: close"
 | 
			
		||||
            // XXX: non-documented `http` module API :(
 | 
			
		||||
            req._last = true;
 | 
			
		||||
            req.shouldKeepAlive = false;
 | 
			
		||||
            let timedOut = false;
 | 
			
		||||
            let timeoutId = null;
 | 
			
		||||
            const timeoutMs = opts.timeout || this.timeout;
 | 
			
		||||
            const onerror = (err) => {
 | 
			
		||||
                if (req._hadError)
 | 
			
		||||
                    return;
 | 
			
		||||
                req.emit('error', err);
 | 
			
		||||
                // For Safety. Some additional errors might fire later on
 | 
			
		||||
                // and we need to make sure we don't double-fire the error event.
 | 
			
		||||
                req._hadError = true;
 | 
			
		||||
            };
 | 
			
		||||
            const ontimeout = () => {
 | 
			
		||||
                timeoutId = null;
 | 
			
		||||
                timedOut = true;
 | 
			
		||||
                const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
 | 
			
		||||
                err.code = 'ETIMEOUT';
 | 
			
		||||
                onerror(err);
 | 
			
		||||
            };
 | 
			
		||||
            const callbackError = (err) => {
 | 
			
		||||
                if (timedOut)
 | 
			
		||||
                    return;
 | 
			
		||||
                if (timeoutId !== null) {
 | 
			
		||||
                    clearTimeout(timeoutId);
 | 
			
		||||
                    timeoutId = null;
 | 
			
		||||
                }
 | 
			
		||||
                onerror(err);
 | 
			
		||||
            };
 | 
			
		||||
            const onsocket = (socket) => {
 | 
			
		||||
                if (timedOut)
 | 
			
		||||
                    return;
 | 
			
		||||
                if (timeoutId != null) {
 | 
			
		||||
                    clearTimeout(timeoutId);
 | 
			
		||||
                    timeoutId = null;
 | 
			
		||||
                }
 | 
			
		||||
                if (isAgent(socket)) {
 | 
			
		||||
                    // `socket` is actually an `http.Agent` instance, so
 | 
			
		||||
                    // relinquish responsibility for this `req` to the Agent
 | 
			
		||||
                    // from here on
 | 
			
		||||
                    debug('Callback returned another Agent instance %o', socket.constructor.name);
 | 
			
		||||
                    socket.addRequest(req, opts);
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                if (socket) {
 | 
			
		||||
                    socket.once('free', () => {
 | 
			
		||||
                        this.freeSocket(socket, opts);
 | 
			
		||||
                    });
 | 
			
		||||
                    req.onSocket(socket);
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
 | 
			
		||||
                onerror(err);
 | 
			
		||||
            };
 | 
			
		||||
            if (typeof this.callback !== 'function') {
 | 
			
		||||
                onerror(new Error('`callback` is not defined'));
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            if (!this.promisifiedCallback) {
 | 
			
		||||
                if (this.callback.length >= 3) {
 | 
			
		||||
                    debug('Converting legacy callback function to promise');
 | 
			
		||||
                    this.promisifiedCallback = promisify_1.default(this.callback);
 | 
			
		||||
                }
 | 
			
		||||
                else {
 | 
			
		||||
                    this.promisifiedCallback = this.callback;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            if (typeof timeoutMs === 'number' && timeoutMs > 0) {
 | 
			
		||||
                timeoutId = setTimeout(ontimeout, timeoutMs);
 | 
			
		||||
            }
 | 
			
		||||
            if ('port' in opts && typeof opts.port !== 'number') {
 | 
			
		||||
                opts.port = Number(opts.port);
 | 
			
		||||
            }
 | 
			
		||||
            try {
 | 
			
		||||
                debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`);
 | 
			
		||||
                Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
 | 
			
		||||
            }
 | 
			
		||||
            catch (err) {
 | 
			
		||||
                Promise.reject(err).catch(callbackError);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        freeSocket(socket, opts) {
 | 
			
		||||
            debug('Freeing socket %o %o', socket.constructor.name, opts);
 | 
			
		||||
            socket.destroy();
 | 
			
		||||
        }
 | 
			
		||||
        destroy() {
 | 
			
		||||
            debug('Destroying agent %o', this.constructor.name);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    createAgent.Agent = Agent;
 | 
			
		||||
    // So that `instanceof` works correctly
 | 
			
		||||
    createAgent.prototype = createAgent.Agent.prototype;
 | 
			
		||||
})(createAgent || (createAgent = {}));
 | 
			
		||||
module.exports = createAgent;
 | 
			
		||||
//# sourceMappingURL=index.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										4
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/promisify.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/promisify.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
import { ClientRequest, RequestOptions, AgentCallbackCallback, AgentCallbackPromise } from './index';
 | 
			
		||||
declare type LegacyCallback = (req: ClientRequest, opts: RequestOptions, fn: AgentCallbackCallback) => void;
 | 
			
		||||
export default function promisify(fn: LegacyCallback): AgentCallbackPromise;
 | 
			
		||||
export {};
 | 
			
		||||
							
								
								
									
										18
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/promisify.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/promisify.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
Object.defineProperty(exports, "__esModule", { value: true });
 | 
			
		||||
function promisify(fn) {
 | 
			
		||||
    return function (req, opts) {
 | 
			
		||||
        return new Promise((resolve, reject) => {
 | 
			
		||||
            fn.call(this, req, opts, (err, rtn) => {
 | 
			
		||||
                if (err) {
 | 
			
		||||
                    reject(err);
 | 
			
		||||
                }
 | 
			
		||||
                else {
 | 
			
		||||
                    resolve(rtn);
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
exports.default = promisify;
 | 
			
		||||
//# sourceMappingURL=promisify.js.map
 | 
			
		||||
							
								
								
									
										1
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/promisify.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/dist/src/promisify.js.map
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
{"version":3,"file":"promisify.js","sourceRoot":"","sources":["../../src/promisify.ts"],"names":[],"mappings":";;AAeA,SAAwB,SAAS,CAAC,EAAkB;IACnD,OAAO,UAAsB,GAAkB,EAAE,IAAoB;QACpE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,EAAE,CAAC,IAAI,CACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,CAAC,GAA6B,EAAE,GAAyB,EAAE,EAAE;gBAC5D,IAAI,GAAG,EAAE;oBACR,MAAM,CAAC,GAAG,CAAC,CAAC;iBACZ;qBAAM;oBACN,OAAO,CAAC,GAAG,CAAC,CAAC;iBACb;YACF,CAAC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAjBD,4BAiBC"}
 | 
			
		||||
							
								
								
									
										91
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										91
									
								
								node_modules/http-proxy-agent/node_modules/agent-base/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,91 @@
 | 
			
		||||
{
 | 
			
		||||
  "_from": "agent-base@6",
 | 
			
		||||
  "_id": "agent-base@6.0.0",
 | 
			
		||||
  "_inBundle": false,
 | 
			
		||||
  "_integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==",
 | 
			
		||||
  "_location": "/http-proxy-agent/agent-base",
 | 
			
		||||
  "_phantomChildren": {},
 | 
			
		||||
  "_requested": {
 | 
			
		||||
    "type": "range",
 | 
			
		||||
    "registry": true,
 | 
			
		||||
    "raw": "agent-base@6",
 | 
			
		||||
    "name": "agent-base",
 | 
			
		||||
    "escapedName": "agent-base",
 | 
			
		||||
    "rawSpec": "6",
 | 
			
		||||
    "saveSpec": null,
 | 
			
		||||
    "fetchSpec": "6"
 | 
			
		||||
  },
 | 
			
		||||
  "_requiredBy": [
 | 
			
		||||
    "/http-proxy-agent"
 | 
			
		||||
  ],
 | 
			
		||||
  "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz",
 | 
			
		||||
  "_shasum": "5d0101f19bbfaed39980b22ae866de153b93f09a",
 | 
			
		||||
  "_spec": "agent-base@6",
 | 
			
		||||
  "_where": "C:\\Users\\matia\\Documents\\GitHub\\Musix-V3\\node_modules\\http-proxy-agent",
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "Nathan Rajlich",
 | 
			
		||||
    "email": "nathan@tootallnate.net",
 | 
			
		||||
    "url": "http://n8.io/"
 | 
			
		||||
  },
 | 
			
		||||
  "bugs": {
 | 
			
		||||
    "url": "https://github.com/TooTallNate/node-agent-base/issues"
 | 
			
		||||
  },
 | 
			
		||||
  "bundleDependencies": false,
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "debug": "4"
 | 
			
		||||
  },
 | 
			
		||||
  "deprecated": false,
 | 
			
		||||
  "description": "Turn a function into an `http.Agent` instance",
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@types/debug": "4",
 | 
			
		||||
    "@types/mocha": "^5.2.7",
 | 
			
		||||
    "@types/node": "^12.12.17",
 | 
			
		||||
    "@types/ws": "^6.0.3",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": "1.6.0",
 | 
			
		||||
    "@typescript-eslint/parser": "1.1.0",
 | 
			
		||||
    "async-listen": "^1.2.0",
 | 
			
		||||
    "cpy-cli": "^2.0.0",
 | 
			
		||||
    "eslint": "5.16.0",
 | 
			
		||||
    "eslint-config-airbnb": "17.1.0",
 | 
			
		||||
    "eslint-config-prettier": "4.1.0",
 | 
			
		||||
    "eslint-import-resolver-typescript": "1.1.1",
 | 
			
		||||
    "eslint-plugin-import": "2.16.0",
 | 
			
		||||
    "eslint-plugin-jsx-a11y": "6.2.1",
 | 
			
		||||
    "eslint-plugin-react": "7.12.4",
 | 
			
		||||
    "mocha": "^6.2.0",
 | 
			
		||||
    "rimraf": "^3.0.0",
 | 
			
		||||
    "typescript": "^3.5.3",
 | 
			
		||||
    "ws": "^3.0.0"
 | 
			
		||||
  },
 | 
			
		||||
  "engines": {
 | 
			
		||||
    "node": ">= 6.0.0"
 | 
			
		||||
  },
 | 
			
		||||
  "files": [
 | 
			
		||||
    "dist/src"
 | 
			
		||||
  ],
 | 
			
		||||
  "homepage": "https://github.com/TooTallNate/node-agent-base#readme",
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "http",
 | 
			
		||||
    "agent",
 | 
			
		||||
    "base",
 | 
			
		||||
    "barebones",
 | 
			
		||||
    "https"
 | 
			
		||||
  ],
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "main": "dist/src/index",
 | 
			
		||||
  "name": "agent-base",
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "git://github.com/TooTallNate/node-agent-base.git"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "build": "tsc",
 | 
			
		||||
    "postbuild": "cpy --parents src test '!**/*.ts' dist",
 | 
			
		||||
    "prebuild": "rimraf dist",
 | 
			
		||||
    "prepublishOnly": "npm run build",
 | 
			
		||||
    "test": "mocha --reporter spec dist/test/*.js",
 | 
			
		||||
    "test-lint": "eslint src --ext .js,.ts"
 | 
			
		||||
  },
 | 
			
		||||
  "typings": "dist/src/index",
 | 
			
		||||
  "version": "6.0.0"
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user