Files
yenai-plugin/lib/request/httpsProxyAgentMod.js
2024-03-10 19:36:58 +08:00

11 lines
353 B
JavaScript

import HttpsProxyAgentOrig from 'https-proxy-agent'
export class HttpsProxyAgent extends HttpsProxyAgentOrig.HttpsProxyAgent {
constructor (opts) {
super(opts)
this.tlsConnectionOptions = opts.tls
const connect = this.connect.bind(this)
this.connect = (req, opts) => connect(req, Object.assign(opts, this.tlsConnectionOptions))
}
}