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.
if (this.protocol)
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
require("https://raw.githubusercontent.com/espruino/EspruinoDocs/master/modules/ws.js")
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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