【问题标题】:Nodejs https request for oauth2 token (google, facebook) produce error 'socket hang up'Nodejs https 请求 oauth2 令牌(google、facebook)产生错误“socket hang up”
【发布时间】:2011-08-06 12:52:57
【问题描述】:

我正在开发 nodejs oauth2 npm 模块:https://github.com/lexer/node-oauth2

当我尝试向 google 或 facebook 发出 https 请求时,我得到:

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: socket hang up
    at Socket.<anonymous> (http.js:1272:45)
    at Socket.emit (events.js:64:17)
    at Array.<anonymous> (net.js:825:12)
    at EventEmitter._tickCallback (node.js:126:26)

您可以在我制作的 express 示例应用程序中重现错误:

https://github.com/lexer/node-oauth2/tree/master/examples/express

【问题讨论】:

    标签: oauth node.js oauth-2.0


    【解决方案1】:

    已解决问题。现在使用 https.request 方法代替带有安全选项“true”的 http.ClientRequest。

    【讨论】:

    • 你能举个例子吗?什么是“https.request”?
    猜你喜欢
    • 2020-08-16
    • 1970-01-01
    • 2018-06-01
    • 2016-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-14
    相关资源
    最近更新 更多