【问题标题】:Node bot configuration issue节点机器人配置问题
【发布时间】:2017-12-13 15:37:16
【问题描述】:

在本地 ubuntu 16.04 服务器上运行的 bot 启动了 Nginx

var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
   console.log('%s listening to %s', server.name, server.url);
});

休息听http://[::]:3978

我可以使用 Channel Emulator 远程连接到服务,但是在聊天中发送消息时,restify 会出错:

WARN: ChatConnector: receive - emulator running without security enabled.
ChatConnector: message received.
The Bot State API is deprecated.  Please refer to https://aka.ms/I6swrh for details on how to replace with your own storage.

**Error: connect ECONNREFUSED 127.0.0.1:55531**
    at Object.exports._errnoException (util.js:870:11)
    at exports._exceptionWithHostPort (util.js:893:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)

有什么想法可以在 55531 上找到吗?

相同的代码在 Windows 机器上工作。

【问题讨论】:

    标签: node.js botframework


    【解决方案1】:

    连接错误与Emulator's 内置ngrok 服务器有关,无论Eumlator 是否配置为根据您的机器人的部署位置使用它。

    您需要在模拟器中配置 App ID 和密码才能连接到远程托管的机器人。在本地测试机器人时,不需要模拟器中配置的 App ID/密码。

    作为参考,模拟器中有一个(复选框)设置,称为“绕过 ngrok 获取本地地址”。确保在本地测试时选中它,而在测试远程托管机器人(或本地 Docker 容器中的机器人)时取消选中。

    【讨论】:

      猜你喜欢
      • 2020-06-23
      • 1970-01-01
      • 2015-02-04
      • 1970-01-01
      • 2021-09-04
      • 2021-09-25
      • 2017-12-14
      • 2020-08-09
      • 1970-01-01
      相关资源
      最近更新 更多