Firebase云端function错误:连接ECONNREFUSED

我正在尝试使用Firebase云端函数根据其API创buildKik Messenger机器人。 我正在使用Blaze Plan。 我正在尝试回复我的机器人收到的消息。 我可以在API上接收消息,但是当我尝试回复消息时,出现错误。 错误不是来自请求callback。 我在Firebase Console上看到了这个错误。

错误:连接ECONNREFUSED 72.14.246.44:443

在Object.exports._errnoException(util.js:1018:11)
在exports._exceptionWithHostPort(util.js:1041:20)
在TCPConnectWrap.afterConnect [ascomplete](net.js:1086:14)
代码:'ECONNREFUSED',
errno:'ECONNREFUSED',
系统调用:'连接',
地址:'72 .14.246.44',
港口:443

对Kik Messenger API的请求适用于本地和远程节点/快递应用程序。 我试图在云端函数上使用kik-node ,但它给出了相同的结果。 What I have discovered so far is that https://auth.kik.com resolves to Amazon and https://api.kik.com resolves to Google Hosting. I thing they are also using Firebase Cloud Functions for their API. Can it be possible that they are blocked inbound requests? Here is the sample code of what I tried.

 exports.messagepost = functions.https.onRequest((req, res) => { // Gives the error below // { // Error: connect ECONNREFUSED 72.14.246.44:443 // at Object.exports._errnoException (util.js:1018:11) // at exports._exceptionWithHostPort (util.js:1041:20) // at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14) // code: 'ECONNREFUSED', // errno: 'ECONNREFUSED', // syscall: 'connect', // address: '72.14.246.44', // port: 443 // } request.post({ uri: 'https://api.kik.com/v1/message', body: JSON.stringify({ foo: 'bar' }), json: true, auth:{ user:'{API_USER}', pass:'{API_KEY}' }, headers: { 'Content-Type' : 'application/json' } }, (error, response) => { if (error) console.error(error); else console.log('Response: ', response.headers); res.status(200).end('OK'); }); }); exports.messageget = functions.https.onRequest((req, res) => { // Gives the error below // { // Error: connect ECONNREFUSED 72.14.246.44:443 // at Object.exports._errnoException (util.js:1018:11) // at exports._exceptionWithHostPort (util.js:1041:20) // at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14) // code: 'ECONNREFUSED', // errno: 'ECONNREFUSED', // syscall: 'connect', // address: '72.14.246.44', // port: 443 // } request.get({ uri: 'https://api.kik.com/v1/message', auth:{ user:'{API_USER}', pass:'{API_KEY}' } }, (error, response) => { if (error) console.error(error); else console.log('Response: ', response.headers); res.status(200).end('OK'); }); }); exports.verificationget = functions.https.onRequest((req, res) => { // Runs with no errors request.get({ uri: 'https://auth.kik.com/verification/v1/check', qs: { u: 'username', d: 'hostname', debug: true }, body: JSON.stringify({ data: 'debugsigneddata' }), headers: { 'Content-Type' : 'application/json' , 'Content-Length' : JSON.stringify({ data: 'debugsigneddata' }).length }, auth:{ user:'{API_USER}', pass:'{API_KEY}' } }, (error, response) => { if (error) console.error(error); else console.log('Response: ', response.headers); res.status(200).end('OK'); }); }); exports.verificationpost = functions.https.onRequest((req, res) => { // Runs with no errors request.post({ uri: 'https://auth.kik.com/verification/v1/check', qs: { u: 'username', d: 'hostname', debug: true }, body: JSON.stringify({ data: 'debugsigneddata' }), headers: { 'Content-Type' : 'application/json' , 'Content-Length' : JSON.stringify({ data: 'debugsigneddata' }).length }, auth:{ user:'{API_USER}', pass:'{API_KEY}' } }, (error, response) => { if (error) console.error(error); else console.log('Response: ', response.headers); res.status(200).end('OK'); }); });