Any way to send just "\n" in Telnet?
You can negotiate binary mode. Once in this mode you cannot leave it. Negotiation means the telnet
client will send a special byte sequence to the server, which you will have to ignore if you are not implementing the protocol.
Subsequent data is sent unchanged, in line mode. Client:
$ telnet localhost 1234
Connected to localhost.
Escape character is '^]'.
^]
telnet> set binary
Negotiating binary mode with remote host.
hi
^]
telnet> quit
and server
$ nc -l 1234 | xxd -c 1
00000000: ff .
00000001: fd .
00000002: 00 .
00000003: ff .
00000004: fb .
00000005: 00 .
00000006: 68 h
00000007: 69 i
00000008: 0a .
Your telnet
client may have an option to start off in binary mode, or you can put an entry in ~/.telnetrc
localhost
set binary
You can apply the binary mode independently in each direction, so you might prefer set outbinary
.