wscat
wscat copied to clipboard
Add support for hexadecimal input/output
This PR adds two options: --hex-in and --hex-out.
If --hex-in is set, input is interpreted as space-separated bytes. E.g., 6a 61 7a 7a 70 69 is interpreted as jazzpi.
If --hex-out is set, anything coming in to the websocket is printed as space-separated bytes. E.g., if wscat is running in --listen-mode and a client sends jazzpi, it's printed out as 6a 61 7a 7a 70 69.
Note: I'm not quite sure about the internals of ws, so I just was cautious and implemented Hex conversion for Buffers, ArrayBuffers and strings (see lines 177-198).
Looks good. Can you resolve the conflicts and I'll merge it?
You will try