but I suspect this is partially so they have a service to sell and some degree of control.
:) Yeah... It does seem to be the business plan of 90% of IoT companies...
You probably don't want to do the server in JavaScript.
The HTTP server in Espruino is actually written in C. It's relatively efficient... Currently WebSockets are in JS but it wouldn't be desperately hard to add websocket support in C as well.
The only gotcha is that the server uses JavaScript variables to store state + data, so when doing a full reset (or load/save) the websocket connection would need to reset. I don't think that's such a big deal though.
Either way, IMO it's not a great idea to have two HTTP servers in Espruino, so finding a way to use the existing one would probably make life easier :)
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.
:) Yeah... It does seem to be the business plan of 90% of IoT companies...
The HTTP server in Espruino is actually written in C. It's relatively efficient... Currently WebSockets are in JS but it wouldn't be desperately hard to add websocket support in C as well.
The only gotcha is that the server uses JavaScript variables to store state + data, so when doing a full reset (or load/save) the websocket connection would need to reset. I don't think that's such a big deal though.
Either way, IMO it's not a great idea to have two HTTP servers in Espruino, so finding a way to use the existing one would probably make life easier :)