From c728eae5ea9fdebb4f2ea821aa8db32c3b16e755 Mon Sep 17 00:00:00 2001 From: Suren Gabrielyan Date: Mon, 22 Apr 2024 10:57:36 +0400 Subject: [PATCH] feat(websocket): adding support for `keep_alive_enable` when using WSS transport --- components/esp_websocket_client/esp_websocket_client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/esp_websocket_client/esp_websocket_client.c b/components/esp_websocket_client/esp_websocket_client.c index 9232cef387..b07e020d43 100644 --- a/components/esp_websocket_client/esp_websocket_client.c +++ b/components/esp_websocket_client/esp_websocket_client.c @@ -497,6 +497,9 @@ static esp_err_t esp_websocket_client_create_transport(esp_websocket_client_hand esp_transport_set_default_port(ssl, WEBSOCKET_SSL_DEFAULT_PORT); esp_transport_list_add(client->transport_list, ssl, "_ssl"); // need to save to transport list, for cleanup + if (client->keep_alive_cfg.keep_alive_enable) { + esp_transport_ssl_set_keep_alive(ssl, &client->keep_alive_cfg); + } if (client->config->use_global_ca_store == true) { esp_transport_ssl_enable_global_ca_store(ssl); } else if (client->config->cert) {