Reputation: 466
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
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