【问题标题】:Node.- issues when trying to request behind https proxyNode.- 尝试在 https 代理后面请求时出现问题
【发布时间】:2018-09-23 01:52:21
【问题描述】:

我正在尝试通过 https 代理从服务器下载图像,请帮助。

我的代码:

var request = require('request');
  request({
   url: url,
   proxy: proxy
   }, function (err, res, imgBuffer) {
    console.log(err)
    console.log(res)
   })

错误: Error: tunneling socket could not be established, cause=write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:827:

我可以提供任何需要的额外信息,我已经尝试了很多。

【问题讨论】:

    标签: javascript node.js ssl https request


    【解决方案1】:

    我认为您需要更改 npm 中的配置文件。

    查看本教程:https://www.jhipster.tech/configuring-a-corporate-proxy/

    转到标题为“NPM 配置”的部分。

    【讨论】:

    • 抱歉,这可能不是我想要的,我的代码设计为根据情况使用大约 5 个代理中的 1 个,这是使用 npm 的公司代理,我不需要,我需要的是让 get 请求通过代理。
    猜你喜欢
    • 1970-01-01
    • 2017-06-08
    • 2015-08-02
    • 2014-04-15
    • 2020-05-06
    • 2020-07-21
    • 2023-02-08
    • 1970-01-01
    • 2018-02-11
    相关资源
    最近更新 更多