Skip to content

Commit fc8c58e

Browse files
committed
feat(websocket): support per-message compression (RFC7692)
1 parent 16cc2dc commit fc8c58e

File tree

5 files changed

+300
-12
lines changed

5 files changed

+300
-12
lines changed

components/esp_websocket_client/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@ if(NOT CONFIG_WS_TRANSPORT AND NOT CMAKE_BUILD_EARLY_EXPANSION)
88
return()
99
endif()
1010

11+
set(PRIV_INCLUDE_LIST esp_timer)
12+
13+
if(CONFIG_ESP_WS_CLIENT_ENABLE_COMPRESSION AND NOT CMAKE_BUILD_EARLY_EXPANSION)
14+
set(PRIV_INCLUDE_LIST ${PRIV_INCLUDE_LIST} zlib)
15+
endif ()
16+
1117
if(${IDF_TARGET} STREQUAL "linux")
1218
idf_component_register(SRCS "esp_websocket_client.c"
1319
INCLUDE_DIRS "include"
1420
REQUIRES esp-tls tcp_transport http_parser esp_event nvs_flash esp_stubs json
15-
PRIV_REQUIRES esp_timer)
21+
PRIV_REQUIRES ${PRIV_INCLUDE_LIST})
1622
else()
1723
idf_component_register(SRCS "esp_websocket_client.c"
1824
INCLUDE_DIRS "include"
1925
REQUIRES lwip esp-tls tcp_transport http_parser esp_event
20-
PRIV_REQUIRES esp_timer)
26+
PRIV_REQUIRES ${PRIV_INCLUDE_LIST})
2127
endif()

components/esp_websocket_client/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,11 @@ menu "ESP WebSocket client"
2020
default 2000
2121
help
2222
Timeout for acquiring the TX lock when using separate TX lock.
23+
24+
config ESP_WS_CLIENT_ENABLE_COMPRESSION
25+
bool "Enable per-message compression support (RFC7692)"
26+
default n
27+
help
28+
Enable this option will build with zlib, and support RFC7692 per-message DEFLATE compression.
29+
2330
endmenu

0 commit comments

Comments
 (0)