【发布时间】:2017-08-31 14:47:51
【问题描述】:
我正在尝试将 axios 与代理服务器一起使用来进行 https 调用:
const url = "https://walmart.com/ip/50676589"
var config = { proxy: { host: proxy.ip, port: proxy.port } }
axios.get(url, config)
.then(result => {})
.catch(error => {console.log(error)})
我使用的代理服务器都在美国,高度匿名,支持 HTTP 和 HTTPS。
我收到此错误:
{ 错误:写入 EPROTO 140736580649920:error:140770FC:SSL 例程:SSL23_GET_SERVER_HELLO:未知 协议:../deps/openssl/openssl/ssl/s23_clnt.c:794:
为了确保问题出在 axios 而不是代理,我尝试了这个:
curl -x 52.8.172.72:4444 -L 'https://www.walmart.com/ip/50676589'
这完全可以正常工作。
如何配置 axios 以使用代理和 https URL?
【问题讨论】:
标签: node.js ssl curl proxy axios