Andrey Nekrasov
Andrey Nekrasov

Reputation: 466

how to send \r\n in the middle of message via telnet(or some other tool)

I need to send to localhost, given port messages like SOME_NUMBER\r\nANOTHER_NUMBER\r\n and recieve answers. I tried telnet, but can't make it send \r\n. I tried double and single quotes but in all attempts it treats \r\n as 4 usual characters.

Upvotes: 1

Views: 2582

Answers (1)

nic
nic

Reputation: 139

If you are using a shell in a UNIX/LINUX/OSX style operating system, you can for example use netcat nc <HOST> <PORT> to open a TCP connection to your destination. Then type the key sequence CTRL-M for carriage return and the CTRL-J for line feed.

Or you open the connection using nc -c <HOST> <PORT>, this makes netcat send CR/LF whenever you hit RETURN.

Upvotes: 2

Related Questions