This is a toy tool that will setup a udp server and a websocket server, and broadcast the data it received from the UDP port to all connected websocket clients.
$ go run main.go -wsaddr 127.0.0.1:6080 -udpaddr 127.0.0.1:6081 -data text
# use -h for help1, Run udp2ws server:
$ go run main.go -wsaddr 127.0.0.1:6080 -udpaddr 127.0.0.1:6081 -data text2, Use wscat to connect to the websocket address
$ wscat --connect 127.0.0.1:60803, Use a udp client connect to the udp address and send some data.
$ nc -u 127.0.0.1 6081
hello worldThen in the 2nd terminal which runs wscat, you should be able to see the data you just sent.