Nodejs https请求oauth2令牌(google,facebook)产生错误'socket hang up'

时间:2011-04-15 17:54:56

标签: oauth node.js oauth-2.0

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

当我尝试向谷歌或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)

您可以重现我所做的快速示例应用程序中的错误:

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

1 个答案:

答案 0 :(得分:0)

修复了问题。现在使用https.request方法而不是带有安全选项“true”的http.ClientRequest。