0

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.

Andrey Nekrasov
  • 456
  • 2
  • 12

1 Answers1

1

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.

nic
  • 119
  • 4