HTTP_SERVER - Websocket Async Connection.
Posted: Thu Jun 09, 2022 10:38 am
Hello!,
I have successfully managed to send logs via ws_echo_example to my browser.
I am receiving data inside and javascript does the rest.
But I also wish to send commands to esp console (so I can actualy work with those logs).
I have another uri whish simply send's user buffer to esp_console_run
But this is under the same httpd_handle_t from the same httpd_req_t
and sending anything does not work until websocket is open.
Any ideas?
I have successfully managed to send logs via ws_echo_example to my browser.
Code: Select all
{.uri = "/ws", .method = HTTP_GET, .handler = websocket_get_handler, .user_ctx = NULL, .is_websocket = true, .handle_ws_control_frames = true, .supported_subprotocol = "chat"},
Code: Select all
socket.onmessage = function(event) {};
But I also wish to send commands to esp console (so I can actualy work with those logs).
I have another uri whish simply send's user buffer to esp_console_run
Code: Select all
{.uri = "/console", .method = HTTP_POST, .handler = console_post_handler, .user_ctx = NULL},
and sending anything does not work until websocket is open.
Any ideas?