我正在尝试使用 NodeJS node-telnet-client 通过 Clearone 连接到 Converge Pro 2,但我仍然无法连接

问题描述

我使用以下配置进行连接:

{
  host: '192.168.10.28',port: 23,shellPrompt: '=>',timeout: 1500,loginPrompt: '/Username[: ]*$/i',passwordPrompt: '/Password: /i',username: 'clearone',password: 'converge'
}

当我在 Windows/PuTTY 中尝试从 Telnet 连接时,它工作正常,连接输出如下:

Telnet connection string

enter image description here

我想我缺少一个配置/参数。这是我正在使用的库的链接https://www.npmjs.com/package/telnet-client

解决方法

在您的配置中添加:

"ors":"\r\n"

说明: 在 telnet-client 节点库中,默认的输出记录分隔符是 \n,这在您的情况下不起作用,因为您的 telnet 服务器似乎在您发出的每个命令后接受 \r\n 即 Windows 样式的换行符.