我正在开发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
答案 0 :(得分:0)
修复了问题。现在使用https.request方法而不是带有安全选项“true”的http.ClientRequest。