mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-10 18:06:29 +00:00
https_server example: Add new WSS server example
Added a new https server example with WS support which runs * keep-alive thread to send PINGs to clients * async message to all active WS clients Moved the existing https-server example to a subfolder Closes https://github.com/espressif/esp-idf/issues/5733 Closes https://github.com/espressif/esp-idf/issues/5686
This commit is contained in:
28
examples/protocols/https_server/wss_server/README.md
Normal file
28
examples/protocols/https_server/wss_server/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# HTTP Websocket server with SSL support
|
||||
|
||||
This example creates a SSL server and employs a simple Websocket request handler. It demonstrates handling multiple clients from the server including:
|
||||
* PING-PONG mechanism
|
||||
* Sending asynchronous messages to all clients
|
||||
|
||||
See the `esp_https_server` component documentation for details.
|
||||
|
||||
Before using the example, open the project configuration menu (`idf.py menuconfig`) to configure Wi-Fi or Ethernet. See "Establishing Wi-Fi or Ethernet Connection" section in [examples/protocols/README.md](../../README.md) for more details.
|
||||
|
||||
## Certificates
|
||||
|
||||
You will need to approve a security exception in your browser. This is because of a self signed
|
||||
certificate; this will be always the case, unless you preload the CA root into your browser/system
|
||||
as trusted.
|
||||
|
||||
You can generate a new certificate using the OpenSSL command line tool:
|
||||
|
||||
```
|
||||
openssl req -newkey rsa:2048 -nodes -keyout prvtkey.pem -x509 -days 3650 -out cacert.pem -subj "/CN=ESP32 HTTPS server example"
|
||||
```
|
||||
|
||||
Expiry time and metadata fields can be adjusted in the invocation.
|
||||
|
||||
Please see the openssl man pages (man openssl-req) for more details.
|
||||
|
||||
It is **strongly recommended** to not reuse the example certificate in your application;
|
||||
it is included only for demonstration.
|
||||
Reference in New Issue
Block a user