Hubot with slack adapter - cannot perform rtm.start

梦想与她 提交于 2019-12-11 12:15:14

问题


I'm trying to have hubot + slack on my local machine. installed hubot and slack client. running:

bin\hubot -a slack

and got error (after adding log messages to the script)

INFO Connecting...

INFO { ok: false, error: { [Error: socket hang up] code: 'ECONNRESET' } }

from reading code in node_modules\slack-client\src\client.js found the problem occurs in a POST request:

   Client.prototype.login = function() {
     this.logger.info('Connecting...');
     return this._apiCall('rtm.start', {
       agent: 'node-slack'
     }, this._onLogin);   };




  Client.prototype._apiCall = function(method, params, callback) {
     var options, post_data, req;
     params['token'] = this.token;
     post_data = querystring.stringify(params);
     options = {
       hostname: this.host,
       method: 'POST',
       path: '/api/' + method,
       headers: {
         'Content-Type': 'application/x-www-form-urlencoded',
         'Content-Length': post_data.length
       }
     };
     req = https.request(options);

tried to do: Node.js POST causes [Error: socket hang up] code: 'ECONNRESET' with no success

来源:https://stackoverflow.com/questions/37253381/hubot-with-slack-adapter-cannot-perform-rtm-start

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!