Cfr. Pieter Hintjens, Code Connected Volume 1, pag. 107 at the moment available for free.
The only fundamental difference is that the client has been "pulled out", due to the actual requirements of Azienda-Online.
You need ZeroMQ installed (follow the instructions) and the php-zmq module enabled to run the client.
Use Haskell Stack and...
stack server.hs
(the very firs time it'll take a while)
php client.php