{"id":13781694,"url":"https://github.com/Links2004/arduinoWebSockets","last_synced_at":"2025-05-11T15:31:58.002Z","repository":{"id":32561895,"uuid":"36144557","full_name":"Links2004/arduinoWebSockets","owner":"Links2004","description":"arduinoWebSockets","archived":false,"fork":false,"pushed_at":"2024-12-29T09:25:09.000Z","size":832,"stargazers_count":1957,"open_issues_count":277,"forks_count":562,"subscribers_count":89,"default_branch":"master","last_synced_at":"2025-04-10T18:31:46.241Z","etag":null,"topics":["arduino-library","esp","esp8266","websocket","websocket-client","websocket-server","websockets","ws","wss"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Links2004.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-23T22:07:09.000Z","updated_at":"2025-04-07T00:37:54.000Z","dependencies_parsed_at":"2024-01-05T14:43:36.773Z","dependency_job_id":"0edc1c46-f473-41b7-a6b5-483379d04586","html_url":"https://github.com/Links2004/arduinoWebSockets","commit_stats":{"total_commits":382,"total_committers":63,"mean_commits":6.063492063492063,"dds":"0.31675392670157065","last_synced_commit":"1789a18ddb0319dc707be3a6588e26f3b3afc04f"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Links2004%2FarduinoWebSockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Links2004%2FarduinoWebSockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Links2004%2FarduinoWebSockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Links2004%2FarduinoWebSockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Links2004","download_url":"https://codeload.github.com/Links2004/arduinoWebSockets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253588586,"owners_count":21932282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino-library","esp","esp8266","websocket","websocket-client","websocket-server","websockets","ws","wss"],"created_at":"2024-08-03T18:01:28.332Z","updated_at":"2025-05-11T15:31:57.974Z","avatar_url":"https://github.com/Links2004.png","language":"C++","funding_links":[],"categories":["硬件_其他","C++","Libraries"],"sub_categories":["资源传输下载"],"readme":"WebSocket Server and Client for Arduino [![Build Status](https://github.com/Links2004/arduinoWebSockets/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Links2004/arduinoWebSockets/actions?query=branch%3Amaster)\r\n===========================================\r\n\r\na WebSocket Server and Client for Arduino based on RFC6455.\r\n\r\n\r\n##### Supported features of RFC6455 #####\r\n - text frame\r\n - binary frame\r\n - connection close\r\n - ping\r\n - pong\r\n - continuation frame\r\n\r\n##### Limitations #####\r\n - max input length is limited to the ram size and the ```WEBSOCKETS_MAX_DATA_SIZE``` define\r\n - max output length has no limit (the hardware is the limit)\r\n - Client send big frames with mask 0x00000000 (on AVR all frames)\r\n - continuation frame reassembly need to be handled in the application code\r\n\r\n ##### Limitations for Async #####\r\n - Functions called from within the context of the websocket event might not honor `yield()` and/or `delay()`.  See [this issue](https://github.com/Links2004/arduinoWebSockets/issues/58#issuecomment-192376395) for more info and a potential workaround.\r\n - wss / SSL is not possible.\r\n\r\n##### Supported Hardware #####\r\n - ESP8266 [Arduino for ESP8266](https://github.com/esp8266/Arduino/)\r\n - ESP32 [Arduino for ESP32](https://github.com/espressif/arduino-esp32)\r\n - ESP31B\r\n - Raspberry Pi Pico W [Arduino for Pico](https://github.com/earlephilhower/arduino-pico)\r\n - Particle with STM32 ARM Cortex M3\r\n - ATmega328 with Ethernet Shield (ATmega branch)\r\n - ATmega328 with enc28j60 (ATmega branch)\r\n - ATmega2560 with Ethernet Shield (ATmega branch)\r\n - ATmega2560 with enc28j60 (ATmega branch)\r\n - Arduino UNO [R4 WiFi](https://github.com/arduino/ArduinoCore-renesas)\r\n - Arduino Nano 33 IoT, MKR WIFI 1010 (requires [WiFiNINA](https://github.com/arduino-libraries/WiFiNINA/) library)\r\n - Seeeduino XIAO, Seeeduino Wio Terminal (requires [rpcWiFi](https://github.com/Seeed-Studio/Seeed_Arduino_rpcWiFi) library)\r\n\r\n###### Note: ######\r\n\r\n  version 2.0.0 and up is not compatible with AVR/ATmega, check ATmega branch.\r\n\r\n  version 2.3.0 has API changes for the ESP8266 BareSSL (may brakes existing code)\r\n\r\n  Arduino for AVR not supports std namespace of c++.\r\n\r\n### wss / SSL ###\r\n supported for:\r\n - wss client on the ESP8266\r\n - wss / SSL for ESP32 in client mode\r\n - wss / SSL is not natively supported in WebSocketsServer however it is possible to achieve secure websockets\r\n   by running the device behind an SSL proxy. See [Nginx](examples/Nginx/esp8266.ssl.reverse.proxy.conf) for a\r\n   sample Nginx server configuration file to enable this.\r\n\r\n### Root CA Cert Bundles for SSL/TLS connections ###\r\n\r\nSecure connections require the certificate of the server to be verified. One option is to provide a single certificate in the chain of trust. However, for flexibility and robustness, a certificate bundle is recommended. If a server changes the root CA from which it derives its certificates, this will not be a problem. With a single CA cert it will not connect.\r\n\r\n - For [technical details](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/protocols/esp_crt_bundle.html)\r\n - For a [PlatformIO setup](https://github.com/Duckle29/esp32-certBundle/)\r\n - For an [example](examples/esp32/WebSocketClientSSLBundle/)\r\n\r\nIncluding a bundle with all CA certs will use 77.2 kB but this list can be reduced to 16.5 kB for the 41 most common. This results in 90% absolute usage coverage and 99% market share coverage according to [W3Techs](https://w3techs.com/technologies/overview/ssl_certificate). The bundle is inserted into the compiled firmware. The bundle is not loaded into RAM, only its index.\r\n\r\n### ESP Async TCP ###\r\n\r\nThis libary can run in Async TCP mode on the ESP.\r\n\r\nThe mode can be activated in the ```WebSockets.h``` (see WEBSOCKETS_NETWORK_TYPE define).\r\n\r\n[ESPAsyncTCP](https://github.com/me-no-dev/ESPAsyncTCP) libary is required.\r\n\r\n\r\n### High Level Client API ###\r\n\r\n - `begin` : Initiate connection sequence to the websocket host.\r\n```c++\r\nvoid begin(const char *host, uint16_t port, const char * url = \"/\", const char * protocol = \"arduino\");\r\nvoid begin(String host, uint16_t port, String url = \"/\", String protocol = \"arduino\");\r\n```\r\n - `onEvent`: Callback to handle for websocket events\r\n\r\n```c++\r\n void onEvent(WebSocketClientEvent cbEvent);\r\n```\r\n\r\n - `WebSocketClientEvent`: Handler for websocket events\r\n```c++\r\n void (*WebSocketClientEvent)(WStype_t type, uint8_t * payload, size_t length)\r\n```\r\nWhere `WStype_t type` is defined as:\r\n```c++\r\n  typedef enum {\r\n      WStype_ERROR,\r\n      WStype_DISCONNECTED,\r\n      WStype_CONNECTED,\r\n      WStype_TEXT,\r\n      WStype_BIN,\r\n      WStype_FRAGMENT_TEXT_START,\r\n      WStype_FRAGMENT_BIN_START,\r\n      WStype_FRAGMENT,\r\n      WStype_FRAGMENT_FIN,\r\n      WStype_PING,\r\n      WStype_PONG,\r\n  } WStype_t;\r\n```\r\n\r\n### Issues ###\r\nSubmit issues to: https://github.com/Links2004/arduinoWebSockets/issues\r\n\r\n### License and credits ###\r\n\r\nThe library is licensed under [LGPLv2.1](https://github.com/Links2004/arduinoWebSockets/blob/master/LICENSE)\r\n\r\n[libb64](http://libb64.sourceforge.net/) written by Chris Venter. It is distributed under Public Domain see [LICENSE](https://github.com/Links2004/arduinoWebSockets/blob/master/src/libb64/LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLinks2004%2FarduinoWebSockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLinks2004%2FarduinoWebSockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLinks2004%2FarduinoWebSockets/lists"}