mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-22 21:23:07 +03:00
* Convert ESP8266WebServer* into templatized model Supercedes #4912 Refactor the three versions of ESP8266WebServer and *WebServerSecure to a single templated class. Use "using" to enable old, non-templated names to b used (so no user changes required to compile or run). Fixes #4908 and clean up the code base a lot. Basic tests run (the ones in the example code). No code changes are required in userland except for setting the SSL certificates which now use a cleaner "getServer()" accessor and lets the app use the native BearSSL calls on the WiFiClientSecure object. @devyte should be proud, it removes virtuals and even has template specialization... * Fix HTTPUpdate templates and examples * Fix HTTPUpdateServer library build Need to remove dot-a linkage since there are no .cpp files in the directory anymore due to templates. * Provide backward-compat names for updt template Allow existing code to use the same well known names for HTTPUpdateSecure. * Remove ClientType from all templates, auto-infer Remove the ClientType template parameter from all objects. Simplifies the code and makes it more foolproof. Add a "using" in each server to define the type of connection returned by all servers, which is then used in the above templates automatically. * Can safely include FS.h now that SD/SPIFFS unified * Move the templates/objects to their own namespaces * Fix merge issues with untemplated methods * Address review comments * Fix mock test, remove warnings inside test dir Make the simple mock test CI job pass and clean up any spurious warnings in the test directory. There still are warnings in the libraries and core, but they should be addressed in a separate PR.
32 lines
1.2 KiB
C++
32 lines
1.2 KiB
C++
/*
|
|
ESP8266WebServerSecure.h - Dead simple HTTPS web-server.
|
|
Supports only one simultaneous client, knows how to handle GET and POST.
|
|
|
|
Copyright (c) 2017 Earle F. Philhower, III. All rights reserved.
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with this library; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#include <ESP8266WebServer.h>
|
|
#include <WiFiClientSecure.h>
|
|
|
|
namespace axTLS {
|
|
using ESP8266WebServerSecure = esp8266webserver::ESP8266WebServerTemplate<WiFiServerSecure>;
|
|
};
|
|
|
|
namespace BearSSL {
|
|
using ESP8266WebServerSecure = esp8266webserver::ESP8266WebServerTemplate<WiFiServerSecure>;
|
|
};
|