Skip to content

jackjansen/esp32_idf5_https_server_compat

 
 

Repository files navigation

esp32_idf5_https_server_compat

This repository is a fork of fhessel/esp32_https_server_compat. The only reason for forking is that the original repository is currently not maintained, and it has become seriously broken for newer boards, and newer releases of ESP-IDF.

If fhessel returns to maintaining his repository this fork will most likely go away (after a warning period).

In the mean time: follow the instructions below, but

  • replace every mention of esp32_https_server_compat with esp32_idf5_https_server_compat
  • replace every mention of esp32_https_server with esp32_idf5_https_server

Original esp32_https_server_compat readme

This library is a wrapper around the TLS-enabled web server for the ESP32 using the Arduino core, to make it compatible with the default Webserver API.

Setup

The setup depends on the IDE that you're using.

Using PlatformIO (recommended)

If you're using PlatformIO, just add esp32\_https\_server\_compat to the library depenendencies in your platform.ini:

[env:myenv]
lib_deps = esp32_https_server_compat

Using the Arduino IDE

Download this library from the releases tab on GitHub and put it into the libraries folder of your Arduino installation. In addition, you need the underlying esp32_https_server library. Download the same version from that repository's releases tab and also put it into the libraries folder besides the previously downloaded library. Restart your IDE if it is currently running.

Usage

The library can be used in the same way as the default WebServer library, with the only difference that you need to include ESPWebServer.hpp instead of WebServer.h:

#include <ESPWebServer.hpp>

ESPWebserver server(80);

void setup() {
  server.begin();
}

void loop() {
  server.handleClient();
}

To use the HTTPS server use <ESPWebServerSecure.hpp> and ESPWebServerSecure in stead of ESPWebServer.

More information and examples can be found in the default WebServer's repository. There are two minimal examples (more test programs, really) in the examples directory.

State of Development

The following issues are known:

  • serveStatic() will serve only a single file or a single directory (as opposed to serving a whole subtree in the default WebServer).
  • serveStatic() does not implement automatic gzip support.
  • serveStatic() knows about only a limited set of mimetypes for file extensions.
  • authenticate() and requestAuthentication() handle only Basic authentication, not Digest authentication.
  • sendHeader() ignores the first=true parameter.
  • collectHeaders() is not implemented.
  • Handling of POST forms with mimetype application/x-www-form-urlencoded is memory-inefficient: the whole POST body is loaded into memory twice.

About

TLS-enabled web server for the ESP32 using the Arduino core, compatible with the default Webserver API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 81.7%
  • Shell 13.5%
  • Python 3.7%
  • C 1.1%