mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-25 01:41:43 +00:00
feat(esp_http_server): Added pre handshake callback for websocket
1. If the user wants authenticate the request, then user needs to do this before upgrading the protocol to websocket. 2. To achieve this, added pre_handshake_callack, which will execute before handshake, i.e. before switching protocol.
This commit is contained in:
@@ -458,6 +458,14 @@ typedef struct httpd_uri {
|
||||
* Pointer to subprotocol supported by URI
|
||||
*/
|
||||
const char *supported_subprotocol;
|
||||
|
||||
#if CONFIG_HTTPD_WS_PRE_HANDSHAKE_CB_SUPPORT || __DOXYGEN__
|
||||
/**
|
||||
* Pointer to WebSocket pre-handshake callback. This will be called before the WebSocket handshake is processed,
|
||||
* i.e. before the server responds with the WebSocket handshake response or before switching to the WebSocket handler.
|
||||
*/
|
||||
esp_err_t (*ws_pre_handshake_cb)(httpd_req_t *req);
|
||||
#endif
|
||||
#endif
|
||||
} httpd_uri_t;
|
||||
|
||||
|
Reference in New Issue
Block a user