would probably work. Unfortunately the way it's done (not actually exporting WebSocket itself) means that you can't actually modify just that function when loading in the library - you'd have to copy the module, change it, and load it in yourself.
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.
Ok, I think the issue is that by default the WebSocket example just uses the
net
library to initialise a connection, nottls
: https://github.com/espruino/EspruinoDocs/blob/master/modules/ws.js#L94So ideally changing the library to do this:
would probably work. Unfortunately the way it's done (not actually exporting
WebSocket
itself) means that you can't actually modify just that function when loading in the library - you'd have to copy the module, change it, and load it in yourself.