No recent searches
Popular Articles
Sorry! nothing found for
Posted over 3 years ago by morx05
Hi, how can i use zyte proxyRequest in node with axios ? or maybe use proxyRequest with async await?Thanks.
0 Votes
1 Comments
Paulo Mesquita posted over 3 years ago
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); }
1 Votes
Login to post a comment
People who like this
This post will be deleted permanently. Are you sure?
We use cookies to try and give you a better experience in Freshdesk.
You can learn more about what kind of cookies we use, why, and how from our Privacy Policy. If you hate cookies, or are just on a diet, you can disable them altogether too. Just note that the Freshdesk service is pretty big on some cookies (we love the choco-chip ones), and some portions of Freshdesk may not work properly if you disable cookies.
We’ll also assume you agree to the way we use cookies and are ok with it as described in our Privacy Policy, unless you choose to disable them altogether through your browser.
Hi, how can i use zyte proxyRequest in node with axios ? or maybe use proxyRequest with async await?
Thanks.
0 Votes
1 Comments
Paulo Mesquita posted over 3 years ago
This works for me:
1 Votes
Login to post a comment