• Hi,
    I've really wanted to use webSockets with the Espruino & esp8266 as an http/webSockets server
    but I was having some issues, namely:

    1. the webSocket handshake was not completing until the server did its first send somewhere later, leaving the client waiting and unable to send data before the server did
    2. the client was closing the socket after 1 minute of inactivity because it was expecting the server to ping
    3. the server didn't know or gracefully close when the the client closed the webSocket

    So I learnt more than I thought I would about the webSocket protocol and made the attached, simple changes that address these requirements (renaming the module to wsX.js just to avoid conflicts). A simple diff between the attached file and the hosted module will show you the few changes and I've added comments to explain, but feel free to remove these.

    I'm now finding webSockets very reliable and doing what I need. I hope the changes I'm offering make it into the hosted module.


    1 Attachment

About

Avatar for Snerkle @Snerkle started