Getting websocket URI user_ctx from client fd?

carhar
Posts: 1
Joined: Tue Jan 25, 2022 11:16 pm

Getting websocket URI user_ctx from client fd?

Postby carhar » Tue Jan 25, 2022 11:36 pm

I'm writing an application with a websocket enabled httpd server and I use two different URIs for websockets.

I also want to send websocket messages that aren't a response to a request, so I iterate over all client fds and test if they are active websocket sessions as proposed in this issue comment.

I would however like to only send the message to client fds that connected trough one of the URIs and I can't seem to find a way of doing this. Does anyone know if it is possible to determine what URI a websocket connection was established to without having access to a httpd_req_t structure?

I have tried to add different user_ctx to the httpd_uri_t structs, but I can't seem to find a way of accessing them without a request (all ways of accessing the ways of accessing ws_user_ctx in the sock_db appears to be locked away in esp_http_priv.h).

Who is online

Users browsing this forum: Majestic-12 [Bot] and 47 guests