In the olden days I had something like this...
const HttpsProxyAgent = require("https-proxy-agent");
new HttpsProxyAgent(URL)
However when I convert to ESM...
import HttpsProxyAgent from "https-proxy-agent";
// Also tried
// import * as HttpsProxyAgent from "https-proxy-agent";
new HttpsProxyAgent(URL)
I get...
(node:7856) UnhandledPromiseRejectionWarning: TypeError: HttpsProxyAgent is not a constructor
So how do I accomplish this now? Is there a native ES6 proxy that node supports?
you can also do:
new HttpsProxyAgent.HttpsProxyAgent(URL);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With