ESP32 HTTPS Server: /home/frank/Projekte/esp32/https_server/esp32_https_server/src/HTTPServer.hpp Source File

1 #ifndef SRC_HTTPSERVER_HPP_

2 #define SRC_HTTPSERVER_HPP_

3 

4 

5 #include <string>

6 

7 

8 #include <Arduino.h>

9 

10 

11 #include "lwip/netdb.h"

12 #undef read

13 #include "lwip/sockets.h"

14 #include "lwip/inet.h"

15 

16 

17 #include "HTTPSServerConstants.hpp"

18 #include "HTTPHeaders.hpp"

19 #include "HTTPHeader.hpp"

20 #include "ResourceNode.hpp"

21 #include "ResourceResolver.hpp"

22 #include "ResolvedResource.hpp"

23 #include "HTTPConnection.hpp"

24 

26 

31 public:

32  HTTPServer(const uint16_t portHTTPS = 80, const uint8_t maxConnections = 8, const in_addr_t bindAddress = 0);

34 

37  bool isRunning();

38 

40 

42 

43 protected:

44 

45 

46  const uint16_t _port;

47 

48 

49  const uint8_t _maxConnections;

50 

51  const in_addr_t _bindAddress;

52 

54 

56 

57  boolean _running;

58 

59  int _socket;

60 

61 

62  sockaddr_in _sock_addr;

63 

65 

66 

68  virtual void teardownSocket();

69 

70 

71  virtual int createConnection(int idx);

72 };

73 

74 }

75 

76 #endif

void loop()

Definition: HTTPServer.cpp:99

Main implementation for the plain HTTP server. Use HTTPSServer for TLS support.

Definition: HTTPServer.hpp:30

virtual uint8_t setupSocket()

Definition: HTTPServer.cpp:170

void setDefaultHeader(std::string name, std::string value)

Definition: HTTPServer.cpp:91

This class is used internally to resolve a string URL to the corresponding HTTPNode.

Definition: ResourceResolver.hpp:22

void stop()

Definition: HTTPServer.cpp:54

Represents a single open connection for the plain HTTPServer, without TLS.

Definition: HTTPConnection.hpp:38

uint8_t start()

Definition: HTTPServer.cpp:35

Definition: ConnectionContext.cpp:3