What you say about the ws lib code & docs is a bit worrying to me. That could make a point switching to something like socket.io which is fairly stable and battle tested, and have a fairly good amount of up to date & accurate documentation available.