mkozjak / node-telnet-client

A simple telnet client for Node.js
Other
350 stars 97 forks source link

Error: Cannot connect #228

Closed xinthose closed 1 year ago

xinthose commented 1 year ago

I am trying to connect to the telnet management port on my OpenVPN server from a Windows 10 PC. I can login manually on Windows with telnet on the command prompt:

telnet
open 10.1.1.196 7505
ENTER PASSWORD:
I copy and paste my password here, then the connection succeeds and I can run OpenVPN commands

My telnet-client config for connect:

{
    "host": "10.1.1.196",
    "port": 7505,
    "passwordPrompt": "ENTER PASSWORD:",
    "password": "ABC123",
    "timeout": 5000,
    "debug": true,
    "ors": "\r\n"
}
await this.telnet.connect(config);    // throws "Error: Cannot connect"

There is no username for login, so do I need to tell the library to skip that or something?

mkozjak commented 1 year ago

Try using negotiationMandatory: false.

xinthose commented 1 year ago

I tried that and now get this error: Error: response not received. In my OpenVPN server logs it shows this:

2023-01-02 16:34:06 MANAGEMENT: Client connected from [AF_INET][undef]:7505
2023-01-02 16:34:25 MANAGEMENT: TCP recv error: Connection reset by peer
2023-01-02 16:34:25 MANAGEMENT: Client disconnected
xinthose commented 1 year ago

I have decided not to use this library. I got things working correctly by using the Node.js net library like in this project. Thank you.