diff options
| author | Priyansh <[email protected]> | 2020-12-22 17:50:12 +0530 |
|---|---|---|
| committer | Priyansh <[email protected]> | 2020-12-22 17:50:12 +0530 |
| commit | 22dc033f4938d6a19e086a1cbd36ec5cade5eaab (patch) | |
| tree | 9feb963ccd5c1581e676e41004801abc67db3357 /node_modules/global-agent/src/classes/HttpsProxyAgent.js | |
| parent | e93da8b04da86773247aadb1cbb1912e4f4526b2 (diff) | |
| download | styx-22dc033f4938d6a19e086a1cbd36ec5cade5eaab.tar.xz styx-22dc033f4938d6a19e086a1cbd36ec5cade5eaab.zip | |
Remove node_modules
Diffstat (limited to 'node_modules/global-agent/src/classes/HttpsProxyAgent.js')
| -rw-r--r-- | node_modules/global-agent/src/classes/HttpsProxyAgent.js | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/node_modules/global-agent/src/classes/HttpsProxyAgent.js b/node_modules/global-agent/src/classes/HttpsProxyAgent.js deleted file mode 100644 index 24d724f..0000000 --- a/node_modules/global-agent/src/classes/HttpsProxyAgent.js +++ /dev/null @@ -1,54 +0,0 @@ -// @flow - -import net from 'net'; -import tls from 'tls'; -import type { - ConnectionCallbackType, - ConnectionConfigurationType, -} from '../types'; -import Agent from './Agent'; - -class HttpsProxyAgent extends Agent { - // eslint-disable-next-line unicorn/prevent-abbreviations - constructor (...args: *) { - super(...args); - - this.protocol = 'https:'; - this.defaultPort = 443; - } - - createConnection (configuration: ConnectionConfigurationType, callback: ConnectionCallbackType) { - const socket = net.connect( - configuration.proxy.port, - configuration.proxy.hostname, - ); - - socket.on('error', (error) => { - callback(error); - }); - - socket.once('data', () => { - const secureSocket = tls.connect({ - ...configuration.tls, - socket, - }); - - callback(null, secureSocket); - }); - - let connectMessage = ''; - - connectMessage += 'CONNECT ' + configuration.host + ':' + configuration.port + ' HTTP/1.1\r\n'; - connectMessage += 'Host: ' + configuration.host + ':' + configuration.port + '\r\n'; - - if (configuration.proxy.authorization) { - connectMessage += 'Proxy-Authorization: Basic ' + Buffer.from(configuration.proxy.authorization).toString('base64') + '\r\n'; - } - - connectMessage += '\r\n'; - - socket.write(connectMessage); - } -} - -export default HttpsProxyAgent; |
