Commit Graph

62 Commits

Author SHA1 Message Date
d85311880d fix(websocket): Close websocket and dispatch event if server does not close within a reasonable amount of time. 2024-01-29 08:01:39 +01:00
2b092e0db4 fix(websocket): Continue waiting for TCP connection to be closed
Prevents an issue where WEBSOCKET_EVENT_CLOSED is not sent after
websocket is closed.
2024-01-23 14:58:27 +01:00
774d1c75e6 fix: continuation after FIN in websocket client (#460) 2023-12-19 17:00:17 +01:00
f523b4dc84 fix(websocket): consider failure if return value of esp_websocket_client_send_with_exact_opcode less than 0 2023-11-28 16:40:10 +04:00
ba33588008 fix(websocket): fix of return value for esp_websocket_client_send_with_opcode API 2023-11-28 12:37:31 +04:00
ac8f1de187 fix(websocket): Return status code correctly on esp_websocket_client_send_with_opcode 2023-10-24 17:23:57 +04:00
39e972544f feat(websocket): Added new API esp_websocket_client_append_header 2023-10-16 12:27:29 +04:00
fae80e2f3f feat(websocket): Added new APIs to support fragmented messages transmission
Intoduced new APIs`esp_websocket_client_send_text_partial`,
            `esp_websocket_client_send_bin_partial`
            `esp_websocket_client_send_cont_mgs`
            `esp_websocket_client_send_fin`
            `esp_websocket_client_send_with_exact_opcode`
2023-10-03 18:43:58 +04:00
a22391ae2c feat(websocket): Added linux port for websocket 2023-07-18 14:18:39 +04:00
b5177cb23a fix(websocket): esp_websocket_client client allow sending 0 byte packets 2023-06-01 15:32:18 +04:00
e085826dbb fix(websocket): Cleaned up printf/format warnings (-Wno-format) 2023-05-17 07:35:21 +02:00
c974c14220 fix(websocket): Added unit tests to CI + minor fix to pass it 2023-05-17 07:14:48 +02:00
8bb207e9bb Fix weird error message spacings 2023-03-23 11:44:51 +01:00
d047ff569c esp_websocket_client:
* Error handling improved to show status code from server
* Added new API `esp_websocket_client_set_headers`
* Dispatches 'WEBSOCKET_EVENT_BEFORE_CONNECT' event before tcp connection
2023-02-22 11:41:33 +04:00
c6db3ea84c unite all tags under common structure
py test: update tags under common structure
2023-02-17 14:27:34 +01:00
1b134486db websocket: Support HTTP basic authorization 2023-02-09 15:09:40 +08:00
7ba1085e9f Merge pull request #32 from 0xFEEDC0DE64/websocketclient-errormsg
Add websocket client error message string (IDFGH-7591)
2023-02-08 16:11:38 +01:00
1d6888445d Add task_name config option 2023-02-08 15:52:03 +01:00
d68624ec4f Add websocket error messages 2023-02-08 15:35:01 +01:00
f9b47900f2 websocket: Added new API esp_websocket_client_destroy_on_exit 2023-01-24 22:29:09 +04:00
3330b96b10 websocket: make esp_websocket_client_send_with_opcode a public API 2022-11-07 16:20:34 +04:00
945bd17701 CI: fixing the files to be complient with pre-commit hooks 2022-10-17 18:16:52 +02:00
4cefcd3606 feat(websocket): Optimize memory size for websocket client init 2022-06-28 21:09:05 +08:00
d56b5d90ea feat(websocket): allow users to attach CA bundle
with esp_transport_ssl_crt_bundle_attach(), it is not necessary to
include a specific certificate. other protocol clients, such as
esp_http_client, do the same.

fixes #48
2022-06-02 12:29:22 +07:00
38149c8d9b Merge pull request #22 from 0xFEEDC0DE64/websocket_client_change_ping_interval
Add methods to allow get/set of websocket client ping interval (IDFGH-7096)
2022-05-03 09:26:54 +02:00
9e37f537bd Implement websocket client connect error 2022-04-26 11:15:57 +02:00
e55f54b69e Add methods to allow get/set of websocket client ping interval 2022-04-26 11:06:20 +02:00
b72a9ae710 esp_websocket_client: Expose frame fin flag in websocket event 2022-04-15 17:06:03 +01:00
b3c777ad43 freertos: Remove legacy data types
This commit removes the usage of all legacy FreeRTOS data types that
are exposed via configENABLE_BACKWARD_COMPATIBILITY. Legacy types can
still be used by enabling CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY.


* Original commit: espressif/esp-idf@57fd78f5ba
2022-03-01 12:18:50 +04:00
8ce791e969 websocket: Added configs reconnect_timeout_ms and network_timeout_ms
Closes https://github.com/espressif/esp-idf/issues/8263


* Original commit: espressif/esp-idf@6c26d65203
2022-03-01 12:18:50 +04:00
46bd32d952 websocket: removed deprecated API "esp_websocket_client_send"
Closes IDF-1470


* Original commit: espressif/esp-idf@7f6ab93f7e
2022-03-01 12:18:50 +04:00
de7cd72f70 components: Remove repeated keep alive function by ssl layer function
In esp_http_client and esp_websocket_client components, esp_transport_tcp_set_keep_alive has been called and keep-alive config has been saved in ssl->cfg.keep_alive_cfg,
So no need to call esp_transport_ssl_set_keep_alive again.


* Original commit: espressif/esp-idf@c79a907e4f
2022-03-01 12:18:50 +04:00
4a608ec1cd components: Support bind socket to specified interface in esp_http_client and esp_websocket_client component
* Original commit: espressif/esp-idf@bead3599ab
2022-03-01 12:18:50 +04:00
f0351ff378 esp_websocket_client: Don't log the filename when logging "Websocket already stop"
Progress towards https://jira.espressif.com:8443/browse/IDFGH-4477


* Original commit: espressif/esp-idf@10bde42551
2022-03-01 12:18:50 +04:00
86aa0b8d39 websockets: Set keepalive options after adding transport to the list
To be in line with other code and mainly to support base/foundation transport used by both tcp and ssl transport layers


* Original commit: espressif/esp-idf@99805d880f
2022-03-01 12:18:50 +04:00
1933367f63 websocket: Add configurable ping interval
Merges https://github.com/espressif/esp-idf/pull/6399

Signed-off-by: David Cermak <cermak@espressif.com>


* Original commit: espressif/esp-idf@9ff9137e7a
2022-03-01 12:18:50 +04:00
95cf983502 ws_transport: Add option to propagate control packets to the app
Client could choose if they want to receive control packets and handle
them.
* If disabled (default) the transport itself tries to handle PING
and CLOSE frames automatically during read operation. If handled
correctly, read outputs 0 indicating no (actual app) data received.
* if enabled, all control frames are passed to the application to be
  processed there.

Closes https://github.com/espressif/esp-idf/issues/6307


* Original commit: espressif/esp-idf@acc7bd2ca4
2022-03-01 12:18:50 +04:00
8a6c320a29 Add options for esp_http_client and esp_websocket_client to support keepalive
* Original commit: espressif/esp-idf@b53e46a68e
2022-03-01 12:18:50 +04:00
d1dd6ece38 websocket: support mutual tls for websocket
Closes https://github.com/espressif/esp-idf/issues/6059


* Original commit: espressif/esp-idf@5ab774f9d8
2022-03-01 12:18:50 +04:00
e90272c812 Websocket client: avoid deadlock if stop called from event handler
* Original commit: espressif/esp-idf@c2bb0762bb
2022-03-01 12:18:50 +04:00
6d12d06605 tcp_transport: Added internal API for underlying socket, used for custom select on connection end for WS
Internal tcp_transport functions could now use custom socket operations.
This is used for WebSocket transport, when we typically wait for clean
connection closure, i.e. selecting for read/error with expected errno or
recv size=0 while socket readable (=connection terminated by FIN flag)


* Original commit: espressif/esp-idf@5e9f8b52e7
2022-03-01 12:18:50 +04:00
1455bc0305 ws_client: Added support for close frame, closing connection gracefully
* Original commit: espressif/esp-idf@b213f2c6d3
2022-03-01 12:18:50 +04:00
01b4f640d9 driver, http_client, web_socket, tcp_transport: remove __FILE__ from log messages
__FILE__ macro in the error messages adds full paths to the production binarys, remove __FILE__ from the ESP_LOGE.

Closes https://github.com/espressif/esp-idf/issues/5637
Merges https://github.com/espressif/esp-idf/pull/5638


* Original commit: espressif/esp-idf@caaf62bdad
2022-03-01 12:18:50 +04:00
6ab0aea841 websocket_client : fix some issues for websocket client
1. will post twice disconnect event when read error
2. will block `timeout` times when set disable_auto_connect
3. When `esp_websocket_client_stop` before `esp_websocket_client_send*`,
if the `esp_websocket_client_send*` fails, the status will change to
 'WEBSOCKET_STATE_WAIT_TIMEOUT', and the next `esp_websocket_client_start` will fail forever


* Original commit: espressif/esp-idf@341e480573
2022-03-01 12:18:50 +04:00
b71c49c277 websocket: add configurable timeout for PONG not received
Closes IDF-1744


* Original commit: espressif/esp-idf@0049385850
2022-03-01 12:18:50 +04:00
f8e3ba7813 websocket client: the client now aborts the connection if send fails.
Closes IDF-1744


* Original commit: espressif/esp-idf@6bebfc84f3
2022-03-01 12:18:50 +04:00
7a5b2d5a7d ws_client: fix fragmented send setting proper opcodes
Previous implementation violated the RFC by having both the actual opcode and WS_FIN flag set for all fragments of a message.
Fixed by setting the opcode only for the first fragment and WS_FIN for the last one

Closes IDFGH-2938
Closes https://github.com/espressif/esp-idf/issues/4974


* Original commit: espressif/esp-idf@14992e62c5
2022-03-01 12:18:50 +04:00
aec6a75d40 tcp_transport/ws_client: websockets now correctly handle messages longer than buffer
transport_ws can now be read multiple times in a row to read frames larger than the buffer.

Added reporting of total payload length and offset to the user in websocket_client.

Added local example test for long messages.

Closes IDF-1083


* Original commit: espressif/esp-idf@ffeda3003c
2022-03-01 12:18:50 +04:00
a6be8e2e3d websocket: added missing event data
user_context was missing from websocket event data, added. Also added the websocket client handle to the event data.

Removed  unused event data struct.

Closes: IDF-1271


* Original commit: espressif/esp-idf@7c0e3765ec
2022-03-01 12:18:50 +04:00
a48b0fafe8 Add User-Agent and additional headers to esp_websocket_client
Merges https://github.com/espressif/esp-idf/pull/4345


* Original commit: espressif/esp-idf@9200250f51
2022-03-01 12:18:50 +04:00