0
I have to develop a client for a proprietary protocol and it would be very useful to be able to understand the behaviour of the existing server by sending it custom messages and look at the answer. "Telnet" would be perfect for that purpose except that the protocol is binary.
So currently, I have written the message i want (using a hex editor) in a file mymsg
and I'm trying to send it using netcat this way:
cat msg | netcat 127.0.0.1 1234
My problem with that is that netcat just stops after it reaches EOF so I never get to see the answer of the server. Any suggestions?
(of course, one can run a mock-up of the proprietary server using nc -l -p 1234
)
I guess the option you mention is -w N . It doesn't work out of the box for me :( . Also I might be missing something but the kludge solution doesn't take input while it is in the sleep part so that's an issue! – user229790 – 2013-06-10T07:34:00.813
@user229790: I think
-w
does something different, it explicitly says "If a connection and stdin are idle for more than...", EOF is not idle.-i
on the other hand sounds like it's worth a try, "Specifies a delay time interval between lines of text sent and received.". – Bobby – 2013-06-10T10:27:46.827