Skip to content

No output (data) from client #5

@eirikb

Description

@eirikb

Hi

Trying to connect to aardwolf.org MUD, and there isn't any output.
Example code:

const telnetlib = require("telnetlib");

const c = telnetlib.createConnection(
  {
    host: "aardwolf.org",
    port: 23,
  },
  () => {
    c.on("data", (data) => {
      console.log("data", data.toString());
    });
  }
);

I'm not sure why, it seems related to this: https://github.com/cadpnq/telnetlib/blob/main/src/TelnetSocket/TelnetReader.js#L43
It works with this hack:

const telnetlib = require("telnetlib");

const c = telnetlib.createConnection(
    {
        host: "aardwolf.org",
        port: 23,
    },
    () => {
        c.reader.flushPolicy.endOfChunk = true;
        c.on("data", (data) => {
            console.log("data", data.toString());
        });
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions