2017-04-05 54 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中找到解決方案。

希望這有助於