Yeah, it’s possible… I tried to give a working example, therefore I needed to implement the other side of the TCP connection too.
Not sure how to compress it to a couple lines (I need to learn this too), tried to do it in this gist. It’s possible that it is still too verbose.