You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IOCP defines TCP Socket classes that can be used for this, and like the other classes, they are low level. When I've built things with J5 that interacted with the world over wifi I always found creating/writing the server to be more of a chore than controlling the hardware itself. Given that, does it make sense to include a barebones HTTP client/server module and possibly a simple router too?
It could be a minimal subset of the node.js HTTP or HTTP2 API.
Not sure this is even doable in a small enough module, but it sure would be nice to make this easier for people.
The text was updated successfully, but these errors were encountered:
To be clear, i have no opinion on what j5e should incorporate. I do have some experience with network protocols on embedded devices, so i'm just responding to 'what is doable" with the hope that what I have to share may be helpful in your decision.
The Moddable SDK contains support for lots of network protocols, including;
DNS client
mDNS - both local name claiming and service advertising & discovery
HTTP client
HTTP server
WebSocket client
WebSocket server
SNTP client (and simple server)
Ping client
MQTT client
MQTT server (experimental)
Those are all written in JavaScript on top of the Moddable SDK's TCP and UDP sockets. (There are some small exceptions where a native function is used for performance, but that's a detail) The IO Class Pattern's TCP and UDP sockets are (more or less) functionally equivalent to the Moddable SDK. These all run on ESP8266 (and ESP32, Qualcomm QCA4020, macOS, Windows, and Linux).
It should be possible to re-host the Moddable SDK network protocol implementations on the IO Class Pattern version. That's something I hope to try, once I have a chance to update the ESP8266 implementation of the IO Class Pattern to match changes made to the specification over the last year.
The network protocol implementations in the Moddable SDK are minimal, to respect the resources of the device. They are more like protocol parsers and serializers than a friendly developer API. For an environment like j5e, they would feel bizarre. But, like you have done with the IO Class Pattern already, you could build up from there to support the protocols you wish with the API style you prefer.
Finally, the Moddable SDK also has a secure socket client (TLS). This may be used with the HTTP, MQTT, and WebSocket clients. It is a layer on top of the TCP socket and so should also be easily adapted to the IO Class Pattern implementation of TCP socket.
The IOCP defines TCP Socket classes that can be used for this, and like the other classes, they are low level. When I've built things with J5 that interacted with the world over wifi I always found creating/writing the server to be more of a chore than controlling the hardware itself. Given that, does it make sense to include a barebones HTTP client/server module and possibly a simple router too?
It could be a minimal subset of the node.js HTTP or HTTP2 API.
Not sure this is even doable in a small enough module, but it sure would be nice to make this easier for people.
The text was updated successfully, but these errors were encountered: