copied, pasted and adapted from
https://github.com/Atmosphere/atmosphere/tree/c25920acb8c8625d9c11db03ca0200c6798f0731/samples/websocket-chat

Change-Id: Ifc5c23f790b3de29babc3f9ea6bfe0172fcf9f1c