ESP32 HTTPS Server: /home/frank/Projekte/esp32/https_server/esp32_https_server/src/HTTPConnection.hpp Source File
1 #ifndef SRC_HTTPCONNECTION_HPP_
2 #define SRC_HTTPCONNECTION_HPP_
17 #include "HTTPSServerConstants.hpp"
18 #include "ConnectionContext.hpp"
23 #include "ResourceResolver.hpp"
24 #include "ResolvedResource.hpp"
26 #include "ResourceNode.hpp"
28 #include "HTTPResponse.hpp"
30 #include "WebsocketHandler.hpp"
31 #include "WebsocketNode.hpp"
44 virtual void closeConnection();
57 virtual size_t writeBuffer(byte* buffer, size_t length);
58 virtual size_t readBytesToBuffer(byte* buffer, size_t length);
59 virtual bool canReadData();
60 virtual size_t pendingByteCount();
63 unsigned long _lastTransmissionTS;
112 void raiseError(uint16_t code, std::string reason);
113 void readLine(int lengthLimit);
119 size_t pendingBufferSize();
122 void signalRequestError();
123 size_t readBuffer(byte* buffer, size_t length);
128 char _receiveBuffer[HTTPS_CONNECTION_DATA_CHUNK_SIZE];
136 struct sockaddr _sockAddr;
146 bool parsingFinished = false;
151 std::string _httpResource;
virtual IPAddress getClientIP()
Definition: HTTPConnection.cpp:65
void handleWebsocketHandshake(HTTPRequest *req, HTTPResponse *res)
Definition: HTTPConnection.cpp:652
Represents the request stream for an HTTP request.
Definition: HTTPRequest.hpp:22
Represents the response stream of an HTTP request.
Definition: HTTPResponse.hpp:25
void validationMiddleware(HTTPRequest *req, HTTPResponse *res, std::function< void()> next)
Definition: HTTPConnection.cpp:622
bool isError()
Definition: HTTPConnection.cpp:99
Definition: WebsocketHandler.hpp:34
This class is used internally to resolve a string URL to the corresponding HTTPNode.
Definition: ResourceResolver.hpp:22
Definition: WebsocketInputStreambuf.hpp:21
Internal class to handle the state of a connection.
Definition: ConnectionContext.hpp:18
Represents a single open connection for the plain HTTPServer, without TLS.
Definition: HTTPConnection.hpp:38
bool isClosed()
Definition: HTTPConnection.cpp:92
std::string websocketKeyResponseHash(std::string const &key)
Definition: HTTPConnection.cpp:664
virtual int initialize(int serverSocketID, HTTPHeaders *defaultHeaders)
Definition: HTTPConnection.cpp:33
Definition: ConnectionContext.cpp:3