2017-04-05 37 views
7

HTTPS请求,我试图用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。

我收到此错误:

{ Error: write EPROTO 140736580649920:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:794:

为了确保问题与爱可信,而不是代理,我尝试这样做:

curl -x 52.8.172.72:4444 -L ' https://www.walmart.com/ip/50676589 '

这完全只是正常工作。

如何配置axios以使用代理和https URL?

回答

0

尝试显式指定URL中的端口:

const url = "https://walmart.com:443/ip/50676589" 

如果您还需要HTTPS over HTTP隧道,您可以在this article中找到解决方案。

希望这有助于