Ahh - that's frustrating. Thanks for checking up - I believe I may have fixed this for the Espruino as client case, but not Espruino as server.
I think the code you pointed to is for the client, and is actually working. if (this.protocol) should be fine.
What was needed was to add that same check for the server case. I've just done it here: https://github.com/espruino/EspruinoDocs/commit/74d779dc5d636d9c6fb2df032a8dfda148961bb9
It's not on the website yet, but you can require("https://raw.githubusercontent.com/espruino/EspruinoDocs/master/modules/ws.js") and test it out
© Espruino, powered by microcosm.
Report a problem