When I have free time I'll first write up the steps of how to create the websocket server itself... I couldn't find any existing documentation when I was creating my own that didn't have assumptions. For example, along the lines of "in the header, you will be given a mask. Use this mask to decode the payload" - that's great and all, but
how do I use the mask. Of course, the official protocol standard (
clicky) had it all in there, but digging around in it was the time consuming part. So hopefully that'll be useful for any of you looking to write one in another language or just check out some fun code (or at least I thought it was).
I will post a new "official" topic for the webserver soon that I can update over the course of the development that'll start with the last webserver version I posted + the websocket support so you can test it ASAP. There is only one flaw I know will happen with it, and that's our friend the null byte. If it just so happens one of the bytes is \x00 in a very rare case, it'll mess up the data transfer for that packet. However, the server can detect when this happens (woo!), and tell the client to simply re-send the last data since the mask is randomized every time. What this means for you guys is you'll just have to paste a snippet of Javascript I end up using for my tests into your pages to handle the re-send request.