This works for me:
const axios = require("axios"); const tunnel = require("tunnel"); const fs = require("fs"); const path = require("path"); async function makeRequest() { const options = { url: requestUrl, method: requestMethod, httpsAgent: tunnel.httpsOverHttp({ ca: [fs.readFileSync(path.resolve(__dirname, "pathToCertificate/yourCertificate.crt"))], // You can download this from zyte API access tutorial proxy: { host: proxyHost, port: proxyPort, proxyAuth: `${proxyAPIKey}:`, }, }), }; const axiosResponse = await axios.request(options); console.log(axiosResponse); }
morx05
Hi, how can i use zyte proxyRequest in node with axios ? or maybe use proxyRequest with async await?
Thanks.