-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: websocket support. #213
Comments
The integration of https://github.com/Molorius/esp32-websocket into the httpsrv isn't easy as the esp32-websocket module works on netconn only. But I made progress by adding an interface in sockets.h to get the socket's netconn and providing that to ws_server_add_client. netconn_write doesn't seem to work on that but using netconn_write_partial it seems to work. I'm not yet sure whether to implement as:
Probably 1. will be easier to implement and provide faster runtime... |
Yes, probably having a single Lua callback will be good enough. You can pass the URL to the handler so it can discriminate between services if needed from inside the Lua code. The handler will also need the socket so it can stream data into the connection with a thread. |
the callback will have the following globals set:
the following values will be given as parameters: sample callback:
also, it will be possible to send a message to all connected websocket clients from any lua script on the system by using |
Nice! |
Good news here. |
Hello, |
It would be great if we could use websockets. That would allow to have complex client side UI, portably, and some light API on the microcontroller side. Do you have any plans?
As alternatives I suppose we could deploy a websocket server in parallel on a separate port (like this one https://github.com/Molorius/esp32-websocket). But the ideal solution is to use an http server with websocket support, or integrate support into httpsrv.c
The text was updated successfully, but these errors were encountered: