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
correct-apricot3y 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-pink
probable-pinkOP3y 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
rival-black3y ago
GitHub
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 endpoints
GitHub
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
correct-apricot3y ago
(1) is used by a lot more peoples, means naturally better tested

Did you find this page helpful?