Skip to content

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

License

Notifications You must be signed in to change notification settings

fhessel/esp32_https_server_compat

Repository files navigation

esp32_https_server_compat

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