Skip to content

Client.write() send incorrect bytes #2

@rextency1

Description

@rextency1

Nate,

Issue we spoke on before.

[app.js]

/*************************************************************************/
var telnet = require('telnet');
telnet.createServer(function (client) {

    client.txtBuffer = new Buffer(256);
    client.do.transmit_binary() // This on or off results in same behavior
    client.will.echo();
    client.do.window_size()
    client.write('\x1B[2J\x1B[H\nConnected to Telnet server! - >\xd4<');
}).listen(23)
/*************************************************************************/

Below is the dump from OSX telnet client, you can see \xd4 isn't actually sent but instead \xc3\x94

telnet> toggle debug
Will turn on socket level debugging.
telnet> toggle netdata
Will print hexadecimal representation of network traffic.
telnet> toggle prettydump
Will print user readable output for "netdata".
telnet> open localhost
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

0x0 _ff fb 25_ff fd 03_ff fb 18_ff fb 1f_ff fb 20_ff
0x10 fb 21_ff fb 22_ff fb 27_ff fd 05_ff fb 23
< 0x0 _ff fd 00
0x0 *ff fb 00
< 0x0 *ff fb 01
0x0 *ff fd 01
< 0x0 *ff fd 1f
0x0 *ff fa 1f 00 99 00 24_ff f0
< 0x0 1b 5b 32 4a 1b 5b 48 0d 0a 43 6f 6e 6e 65 63 74
< 0x10 65 64 20 74 6f 20 54 65 6c 6e 65 74 20 73 65 72
< 0x20 76 65 72 21 20 2d 20 3e c3 94 3c

Connected to Telnet server! - >Ô<

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