This commit is contained in:
Mathieu Carbou
2025-01-20 16:07:01 +01:00
parent 2e461f6f3d
commit 7f35106299
10 changed files with 46 additions and 76 deletions

13
.github/FUNDING.yml vendored
View File

@ -1,13 +0,0 @@
# These are supported funding model platforms
github: mathieucarbou
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
# ko_fi: # Replace with a single Ko-fi username
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
# liberapay: # Replace with a single Liberapay username
# issuehunt: # Replace with a single IssueHunt username
# otechie: # Replace with a single Otechie username
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: https://paypal.me/mathieucarboufr

View File

@ -6,11 +6,11 @@ labels: triage
assignees: "" assignees: ""
--- ---
**Only for bugs found in the library! Otherwise, please go to the [discussions section](https://github.com/mathieucarbou/ESPAsyncWebServer/discussions)!** **Only for bugs found in the library! Otherwise, please go to the [discussions section](https://github.com/ESP32Async/ESPAsyncWebServer/discussions)!**
**Please make sure to go through the recommendations before opening a bug report:** **Please make sure to go through the recommendations before opening a bug report:**
[https://github.com/mathieucarbou/ESPAsyncWebServer?tab=readme-ov-file#important-recommendations](https://github.com/mathieucarbou/ESPAsyncWebServer?tab=readme-ov-file#important-recommendations) [https://github.com/ESP32Async/ESPAsyncWebServer?tab=readme-ov-file#important-recommendations](https://github.com/ESP32Async/ESPAsyncWebServer?tab=readme-ov-file#important-recommendations)
**Description** **Description**

View File

@ -6,4 +6,4 @@ labels: question
assignees: "" assignees: ""
--- ---
**For questions: please go to the [discussions section](https://github.com/mathieucarbou/ESPAsyncWebServer/discussions)!** **For questions: please go to the [discussions section](https://github.com/ESP32Async/ESPAsyncWebServer/discussions)!**

View File

@ -55,11 +55,11 @@ jobs:
- name: Install AsyncTCP (ESP32) - name: Install AsyncTCP (ESP32)
if: ${{ matrix.core == 'esp32:esp32' }} if: ${{ matrix.core == 'esp32:esp32' }}
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/mathieucarbou/AsyncTCP#v3.3.2 run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/ESP32Async/AsyncTCP#v3.3.2
- name: Install ESPAsyncTCP (ESP8266) - name: Install ESPAsyncTCP (ESP8266)
if: ${{ matrix.core == 'esp8266:esp8266' }} if: ${{ matrix.core == 'esp8266:esp8266' }}
run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/mathieucarbou/esphome-ESPAsyncTCP#v2.0.0 run: ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/ESP32Async/ESPAsyncTCP#v2.0.0
- name: Install AsyncTCP (RP2040) - name: Install AsyncTCP (RP2040)
if: ${{ matrix.core == 'rp2040:rp2040' }} if: ${{ matrix.core == 'rp2040:rp2040' }}

View File

@ -1,14 +1,14 @@
# ESPAsyncWebServer # ESPAsyncWebServer
[![Latest Release](https://img.shields.io/github/release/mathieucarbou/ESPAsyncWebServer.svg)](https://GitHub.com/mathieucarbou/ESPAsyncWebServer/releases/) [![Latest Release](https://img.shields.io/github/release/ESP32Async/ESPAsyncWebServer.svg)](https://GitHub.com/ESP32Async/ESPAsyncWebServer/releases/)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/mathieucarbou/library/ESPAsyncWebServer.svg)](https://registry.platformio.org/libraries/mathieucarbou/ESPAsyncWebServer) [![PlatformIO Registry](https://badges.registry.platformio.org/packages/ESP32Async/library/ESPAsyncWebServer.svg)](https://registry.platformio.org/libraries/ESP32Async/ESPAsyncWebServer)
[![License: LGPL 3.0](https://img.shields.io/badge/License-LGPL%203.0-yellow.svg)](https://opensource.org/license/lgpl-3-0/) [![License: LGPL 3.0](https://img.shields.io/badge/License-LGPL%203.0-yellow.svg)](https://opensource.org/license/lgpl-3-0/)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)
[![Build](https://github.com/mathieucarbou/ESPAsyncWebServer/actions/workflows/ci.yml/badge.svg)](https://github.com/mathieucarbou/ESPAsyncWebServer/actions/workflows/ci.yml) [![Build](https://github.com/ESP32Async/ESPAsyncWebServer/actions/workflows/ci.yml/badge.svg)](https://github.com/ESP32Async/ESPAsyncWebServer/actions/workflows/ci.yml)
[![GitHub latest commit](https://badgen.net/github/last-commit/mathieucarbou/ESPAsyncWebServer)](https://GitHub.com/mathieucarbou/ESPAsyncWebServer/commit/) [![GitHub latest commit](https://badgen.net/github/last-commit/ESP32Async/ESPAsyncWebServer)](https://GitHub.com/ESP32Async/ESPAsyncWebServer/commit/)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/mathieucarbou/ESPAsyncWebServer) [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ESP32Async/ESPAsyncWebServer)
Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266 and RP2040 Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266 and RP2040
Supports: WebSocket, SSE, Authentication, Arduino Json 7, File Upload, Static File serving, URL Rewrite, URL Redirect, etc. Supports: WebSocket, SSE, Authentication, Arduino Json 7, File Upload, Static File serving, URL Rewrite, URL Redirect, etc.
@ -42,7 +42,7 @@ This fork is based on [yubox-node-org/ESPAsyncWebServer](https://github.com/yubo
- (feat) **Resumable download** support using HEAD and bytes range - (feat) **Resumable download** support using HEAD and bytes range
- (feat) `StreamConcat` example to show how to stream multiple files in one response - (feat) `StreamConcat` example to show how to stream multiple files in one response
- (feat) Removed ESPIDF Editor (this is not the role of a web server library to do that - get the source files from the original repos if required) - (feat) Removed ESPIDF Editor (this is not the role of a web server library to do that - get the source files from the original repos if required)
- (perf) [AsyncTCPSock](https://github.com/mathieucarbou/AsyncTCPSock) support: AsyncTCP can be ignored and AsyncTCPSock used instead - (perf) [AsyncTCPSock](https://github.com/ESP32Async/AsyncTCPSock) support: AsyncTCP can be ignored and AsyncTCPSock used instead
- (perf) `char*` overloads to avoid using `String` - (perf) `char*` overloads to avoid using `String`
- (perf) `DEFAULT_MAX_WS_CLIENTS` to change the number of allows WebSocket clients and use `cleanupClients()` to help cleanup resources about dead clients - (perf) `DEFAULT_MAX_WS_CLIENTS` to change the number of allows WebSocket clients and use `cleanupClients()` to help cleanup resources about dead clients
- (perf) `setCloseClientOnQueueFull(bool)` which can be set on a client to either close the connection or discard messages but not close the connection when the queue is full - (perf) `setCloseClientOnQueueFull(bool)` which can be set on a client to either close the connection or discard messages but not close the connection when the queue is full
@ -83,18 +83,18 @@ If you are an ESP8266 user and want to help improve current 3.x, you are more th
```ini ```ini
lib_compat_mode = strict lib_compat_mode = strict
lib_ldf_mode = chain lib_ldf_mode = chain
lib_deps = mathieucarbou/ESPAsyncWebServer @ 3.6.0 lib_deps = ESP32Async/ESPAsyncWebServer @ 3.6.0
``` ```
**Dependencies:** **Dependencies:**
- **ESP32 with AsyncTCP**: `mathieucarbou/AsyncTCP @ 3.3.2` - **ESP32 with AsyncTCP**: `ESP32Async/AsyncTCP @ 3.3.2`
Arduino IDE: [https://github.com/mathieucarbou/AsyncTCP#v3.3.2](https://github.com/mathieucarbou/AsyncTCP/releases) Arduino IDE: [https://github.com/ESP32Async/AsyncTCP#v3.3.2](https://github.com/ESP32Async/AsyncTCP/releases)
- **ESP32 with AsyncTCPSock**: `https://github.com/mathieucarbou/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip` - **ESP32 with AsyncTCPSock**: `https://github.com/ESP32Async/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip`
- **ESP8266**: `esphome/ESPAsyncTCP-esphome @ 2.0.0` - **ESP8266**: `ESP32Async/ESPAsyncTCP @ 2.0.0`
Arduino IDE: [https://github.com/mathieucarbou/esphome-ESPAsyncTCP#v2.0.0](https://github.com/mathieucarbou/esphome-ESPAsyncTCP/releases/tag/v2.0.0) Arduino IDE: [https://github.com/ESP32Async/ESPAsyncTCP#v2.0.0](https://github.com/ESP32Async/ESPAsyncTCP/releases/tag/v2.0.0)
- **RP2040**: `khoih-prog/AsyncTCP_RP2040W @ 1.2.0` - **RP2040**: `khoih-prog/AsyncTCP_RP2040W @ 1.2.0`
Arduino IDE: [https://github.com/khoih-prog/AsyncTCP_RP2040W#v1.2.0](https://github.com/khoih-prog/AsyncTCP_RP2040W/releases/tag/v1.2.0) Arduino IDE: [https://github.com/khoih-prog/AsyncTCP_RP2040W#v1.2.0](https://github.com/khoih-prog/AsyncTCP_RP2040W/releases/tag/v1.2.0)
@ -107,28 +107,28 @@ AsyncTCPSock can be used instead of AsyncTCP by excluding AsyncTCP from the libr
lib_compat_mode = strict lib_compat_mode = strict
lib_ldf_mode = chain lib_ldf_mode = chain
lib_deps = lib_deps =
; mathieucarbou/AsyncTCP @ 3.3.2 ; ESP32Async/AsyncTCP @ 3.3.2
https://github.com/mathieucarbou/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip https://github.com/ESP32Async/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip
mathieucarbou/ESPAsyncWebServer @ 3.6.0 ESP32Async/ESPAsyncWebServer @ 3.6.0
lib_ignore = lib_ignore =
AsyncTCP AsyncTCP
mathieucarbou/AsyncTCP ESP32Async/AsyncTCP
``` ```
## Performance ## Performance
Performance of `mathieucarbou/ESPAsyncWebServer @ 3.6.0`: Performance of `ESP32Async/ESPAsyncWebServer @ 3.6.0`:
```bash ```bash
> brew install autocannon > brew install autocannon
> autocannon -c 10 -w 10 -d 20 http://192.168.4.1 > autocannon -c 10 -w 10 -d 20 http://192.168.4.1
``` ```
With `mathieucarbou/AsyncTCP @ 3.3.2` With `ESP32Async/AsyncTCP @ 3.3.2`
<img width="629" alt="perf-c10" src="https://github.com/user-attachments/assets/b4b7f953-c24d-4e04-8d87-ba3f26805737" /> <img width="629" alt="perf-c10" src="https://github.com/user-attachments/assets/b4b7f953-c24d-4e04-8d87-ba3f26805737" />
With `https://github.com/mathieucarbou/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip`: With `https://github.com/ESP32Async/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip`:
<img width="654" alt="perf-c10-asynctcpsock" src="https://github.com/user-attachments/assets/0dacf133-ca47-40be-939b-e6f60fc95b81" /> <img width="654" alt="perf-c10-asynctcpsock" src="https://github.com/user-attachments/assets/0dacf133-ca47-40be-939b-e6f60fc95b81" />
@ -253,7 +253,7 @@ Middleware is a way to intercept requests to perform some operations on them, li
Middleware can either be attached to individual handlers, attached at the server level (thus applied to all handlers), or both. Middleware can either be attached to individual handlers, attached at the server level (thus applied to all handlers), or both.
They will be executed in the order they are attached, and they can stop the request processing by sending a response themselves. They will be executed in the order they are attached, and they can stop the request processing by sending a response themselves.
You can have a look at the [SimpleServer.ino](https://github.com/mathieucarbou/ESPAsyncWebServer/blob/main/examples/SimpleServer/SimpleServer.ino) example for some use cases. You can have a look at the [SimpleServer.ino](https://github.com/ESP32Async/ESPAsyncWebServer/blob/main/examples/SimpleServer/SimpleServer.ino) example for some use cases.
For example, such middleware would handle authentication and set some attributes on the request to make them available for the next middleware and for the handler which will process the request. For example, such middleware would handle authentication and set some attributes on the request to make them available for the next middleware and for the handler which will process the request.
@ -321,15 +321,6 @@ myHandler.addMiddleware(&authMiddleware); // add authentication to a specific ha
These callbacks can be called multiple times during request parsing, so this is up to the user to now call the `AsyncAuthenticationMiddleware.allowed(request)` if needed and ideally when the method is called for the first time. These callbacks can be called multiple times during request parsing, so this is up to the user to now call the `AsyncAuthenticationMiddleware.allowed(request)` if needed and ideally when the method is called for the first time.
These callbacks are also not triggering the whole middleware chain since they are not part of the request processing workflow (they are not the final handler). These callbacks are also not triggering the whole middleware chain since they are not part of the request processing workflow (they are not the final handler).
## Maintainers
This fork of ESPAsyncWebServer and dependend libs are maintained as an opensource project at best effort level.
- [Mathieu Carbou](https://github.com/mathieucarbou)
- [Emil Muratov](https://github.com/vortigont)
Thanks to all who contributed by providing PRs, testing and reporting issues.
## Original Documentation ## Original Documentation
<!-- no toc --> <!-- no toc -->
- [Why should you care](#why-should-you-care) - [Why should you care](#why-should-you-care)

View File

@ -1,4 +1,4 @@
// Reproduced issue https://github.com/mathieucarbou/ESPAsyncWebServer/issues/26 // Reproduced issue https://github.com/ESP32Async/ESPAsyncWebServer/issues/26
#include <DNSServer.h> #include <DNSServer.h>
#ifdef ESP32 #ifdef ESP32

View File

@ -3,24 +3,16 @@
"version": "3.6.0", "version": "3.6.0",
"description": "Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266 and RP2040. Supports: WebSocket, SSE, Authentication, Arduino Json 7, File Upload, Static File serving, URL Rewrite, URL Redirect, etc.", "description": "Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266 and RP2040. Supports: WebSocket, SSE, Authentication, Arduino Json 7, File Upload, Static File serving, URL Rewrite, URL Redirect, etc.",
"keywords": "http,async,websocket,webserver", "keywords": "http,async,websocket,webserver",
"homepage": "https://github.com/mathieucarbou/ESPAsyncWebServer", "homepage": "https://github.com/ESP32Async/ESPAsyncWebServer",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/mathieucarbou/ESPAsyncWebServer.git" "url": "https://github.com/ESP32Async/ESPAsyncWebServer.git"
},
"authors":
{
"name": "ESP32Async",
"maintainer": true
}, },
"authors": [
{
"name": "Hristo Gochkov"
},
{
"name": "Mathieu Carbou",
"maintainer": true
},
{
"name": "Emil Muratov",
"maintainer": true
}
],
"license": "LGPL-3.0", "license": "LGPL-3.0",
"frameworks": "arduino", "frameworks": "arduino",
"platforms": [ "platforms": [
@ -30,14 +22,14 @@
], ],
"dependencies": [ "dependencies": [
{ {
"owner": "mathieucarbou", "owner": "ESP32Async",
"name": "AsyncTCP", "name": "AsyncTCP",
"version": "^3.3.2", "version": "^3.3.2",
"platforms": "espressif32" "platforms": "espressif32"
}, },
{ {
"owner": "esphome", "owner": "ESP32Async",
"name": "ESPAsyncTCP-esphome", "name": "ESPAsyncTCP",
"version": "^2.0.0", "version": "^2.0.0",
"platforms": "espressif8266" "platforms": "espressif8266"
}, },

View File

@ -1,11 +1,11 @@
name=ESP Async WebServer name=ESP Async WebServer
includes=ESPAsyncWebServer.h includes=ESPAsyncWebServer.h
version=3.6.0 version=3.6.0
author=Me-No-Dev author=ESP32Async
maintainer=Mathieu Carbou <mathieu.carbou@gmail.com> maintainer=ESP32Async
sentence=Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266 and RP2040 sentence=Asynchronous HTTP and WebSocket Server Library for ESP32, ESP8266 and RP2040
paragraph=Supports: WebSocket, SSE, Authentication, Arduino Json 7, File Upload, Static File serving, URL Rewrite, URL Redirect, etc paragraph=Supports: WebSocket, SSE, Authentication, Arduino Json 7, File Upload, Static File serving, URL Rewrite, URL Redirect, etc
category=Other category=Other
url=https://github.com/mathieucarbou/ESPAsyncWebServer url=https://github.com/ESP32Async/ESPAsyncWebServer
architectures=* architectures=*
license=LGPL-3.0 license=LGPL-3.0

View File

@ -31,7 +31,7 @@ lib_deps =
; bblanchon/ArduinoJson @ 5.13.4 ; bblanchon/ArduinoJson @ 5.13.4
; bblanchon/ArduinoJson @ 6.21.5 ; bblanchon/ArduinoJson @ 6.21.5
bblanchon/ArduinoJson @ 7.3.0 bblanchon/ArduinoJson @ 7.3.0
mathieucarbou/AsyncTCP @ 3.3.2 ESP32Async/AsyncTCP @ 3.3.2
board = esp32dev board = esp32dev
board_build.partitions = partitions-4MB.csv board_build.partitions = partitions-4MB.csv
board_build.filesystem = littlefs board_build.filesystem = littlefs
@ -49,7 +49,7 @@ platform = https://github.com/pioarduino/platform-espressif32/releases/download/
; board = esp32-s3-devkitc-1 ; board = esp32-s3-devkitc-1
; board = esp32-c6-devkitc-1 ; board = esp32-c6-devkitc-1
lib_deps = lib_deps =
mathieucarbou/AsyncTCP @ 3.3.2 ESP32Async/AsyncTCP @ 3.3.2
[env:arduino-311] [env:arduino-311]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip
@ -65,7 +65,7 @@ build_flags = ${env.build_flags}
[env:perf-test-AsyncTCPSock] [env:perf-test-AsyncTCPSock]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip
lib_deps = lib_deps =
https://github.com/mathieucarbou/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip https://github.com/ESP32Async/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip
build_flags = ${env.build_flags} build_flags = ${env.build_flags}
-D PERF_TEST=1 -D PERF_TEST=1
@ -75,7 +75,7 @@ platform = espressif8266
board = d1_mini board = d1_mini
lib_deps = lib_deps =
bblanchon/ArduinoJson @ 7.3.0 bblanchon/ArduinoJson @ 7.3.0
esphome/ESPAsyncTCP-esphome @ 2.0.0 ESP32Async/ESPAsyncTCP @ 2.0.0
[env:raspberrypi] [env:raspberrypi]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git platform = https://github.com/maxgerhardt/platform-raspberrypi.git
@ -103,7 +103,7 @@ board = ${sysenv.PIO_BOARD}
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.05/platform-espressif32.zip platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.05/platform-espressif32.zip
board = ${sysenv.PIO_BOARD} board = ${sysenv.PIO_BOARD}
lib_deps = lib_deps =
mathieucarbou/AsyncTCP @ 3.3.2 ESP32Async/AsyncTCP @ 3.3.2
[env:ci-arduino-311] [env:ci-arduino-311]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip
@ -114,7 +114,7 @@ platform = espressif8266
board = ${sysenv.PIO_BOARD} board = ${sysenv.PIO_BOARD}
lib_deps = lib_deps =
bblanchon/ArduinoJson @ 7.3.0 bblanchon/ArduinoJson @ 7.3.0
esphome/ESPAsyncTCP-esphome @ 2.0.0 ESP32Async/ESPAsyncTCP @ 2.0.0
[env:ci-raspberrypi] [env:ci-raspberrypi]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git platform = https://github.com/maxgerhardt/platform-raspberrypi.git

View File

@ -52,7 +52,7 @@
#define ASYNCWEBSERVER_VERSION_MAJOR 3 #define ASYNCWEBSERVER_VERSION_MAJOR 3
#define ASYNCWEBSERVER_VERSION_MINOR 6 #define ASYNCWEBSERVER_VERSION_MINOR 6
#define ASYNCWEBSERVER_VERSION_REVISION 0 #define ASYNCWEBSERVER_VERSION_REVISION 0
#define ASYNCWEBSERVER_FORK_mathieucarbou #define ASYNCWEBSERVER_FORK_ESP32Async
#ifdef ASYNCWEBSERVER_REGEX #ifdef ASYNCWEBSERVER_REGEX
#define ASYNCWEBSERVER_REGEX_ATTRIBUTE #define ASYNCWEBSERVER_REGEX_ATTRIBUTE