Axios Proxy - only HTTP protocol is supported
Hi, I kept getting 'Only HTTP protocol is supported (was https:)' when I tried to make axios request from a cloud Actor. I was following this doc https://docs.apify.com/proxy/datacenter-proxy/examples#use-ip-rotation
Apify
Examples · Apify Documentation
Learn how to connect to Apify's datacenter proxies from your application with Node.js (axios and got-scraping), Python 2 and 3 and PHP using code examples.
4 Replies
correct-apricot•3y ago
import HttpsProxyAgent from 'https-proxy-agent';
import axios from 'axios';
const proxyUrl = await proxyConfiguration.newUrl();
axios.defaults.proxy = false;
axios.defaults.httpsAgent = new HttpsProxyAgent(proxyUrl);
probable-pinkOP•3y ago
Thanks! I ended up solving it using this one. I guess it's a similar thing https://docs.apify.com/proxy/datacenter-proxy/examples#multiple-requests-with-the-same-ip-address
Apify
Examples · Apify Documentation
Learn how to connect to Apify's datacenter proxies from your application with Node.js (axios and got-scraping), Python 2 and 3 and PHP using code examples.
rival-black•3y ago
Why
https-proxy-agent
[1] and not hpagent
[2] ?
[1] https://github.com/TooTallNate/node-https-proxy-agent
[2] https://github.com/delvedor/hpagentGitHub
GitHub - TooTallNate/node-https-proxy-agent: An HTTP(s) proxy `http...
An HTTP(s) proxy
http.Agent
implementation for HTTPS endpoints - GitHub - TooTallNate/node-https-proxy-agent: An HTTP(s) proxy http.Agent
implementation for HTTPS endpointsGitHub
GitHub - delvedor/hpagent: A ready to use http and https agent for ...
A ready to use http and https agent for working with proxies that keeps connections alive! - GitHub - delvedor/hpagent: A ready to use http and https agent for working with proxies that keeps conne...
correct-apricot•3y ago
(1) is used by a lot more peoples, means naturally better tested