The following demonstration uses netcat to connect endpoints and http api to get historical statistics
Go 1.12+
go build -o server .
cross-compile guide: https://golangcookbook.com/chapters/running/cross-compiling/
./server
This will start the server listening on port 8080 for TCP connections and 8081 for HTTP requests.
nc localhost 8080
Hello world!
curl http://localhost:8081/stats
This will return a JSON object containing the server statistics.