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 websockets allow a two-way communication between the client and server, so it's more well suited for IoT applications where one would like to stream data.
Being an upgradable protocol from HTTP this means the existing infrastructure can still handle websockets connections.
The nodemcu offers an net module for more raw control of the connection - this, however, is an higher-level protocol that sits on the same level of abstraction of the http.
The main advantage for a native module is heap usage.
Workarounds
There are 2 projects that implement this in Lua [1][2]. Both use more than 10KB of heap.
Implementation
I'm aware this is a non-trivial effort, therefore I'm also volunteering to do this myself. Although I feel I should reach out for possible implementation discussion & comments.
I'm also more interested in a client version, although after a client is done, a server should not be too hard.
The text was updated successfully, but these errors were encountered:
I've found some problems with the websockets module while using secure connections. While it would work with something like wss://echo.websocket.org, it didn't with my tornado development server.
For some reason, its callbacks are called with an empty buffer and len == 0 and the code stops working. I've added some checks for those cases and it seems to work.
Missing feature
A native Websocket module.
Justification
The websockets allow a two-way communication between the client and server, so it's more well suited for IoT applications where one would like to stream data.
Being an upgradable protocol from HTTP this means the existing infrastructure can still handle websockets connections.
The nodemcu offers an
net
module for more raw control of the connection - this, however, is an higher-level protocol that sits on the same level of abstraction of thehttp
.The main advantage for a native module is heap usage.
Workarounds
There are 2 projects that implement this in Lua [1] [2]. Both use more than 10KB of heap.
Implementation
I'm aware this is a non-trivial effort, therefore I'm also volunteering to do this myself. Although I feel I should reach out for possible implementation discussion & comments.
I'm also more interested in a client version, although after a client is done, a server should not be too hard.
The text was updated successfully, but these errors were encountered: