UDP chat server
UDP packets that are received are decoded as JSON and then sent to every address that has previously successfully delivered a message.
To run it:
-
Start the server in one terminal:
stack run
-
Send UDP packets from a separate terminal. On Windows with Nmap's
ncat(assuming IPv6):C:\Users\me>ncat -v -u -6 localhost 1337
You can then type JSON messages like:
{"msg":"hello","to":0} -
Server operator can respond via the TUI - simply type your message in the input box and press Enter to send it to all connected peers.