-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.h
65 lines (55 loc) · 1.52 KB
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* @note General Server Configuration.
* This section contains general server configuration options.
*/
#ifndef HTTP_C_SERVER_H
#define HTTP_C_SERVER_H
/**
* The port the server will listen on.
*/
#define SERVER_PORT 31337
/**
* The maximum size of server data buffer.
*/
#define SERVER_BUFFER_SIZE 1024 * 1024
/**
* The maximum number of connections the server will accept.
*/
#define SERVER_MAX_CONNECTIONS 5
/**
* The server signature.
* This will be sent as the Server header in the response.
* Feel free to change this to your own server signature.
*/
#define SERVER_SIGNATURE "LLDM/0.1 HTTP Server"
/**
* The document root of the server.
* @warning This path is relative to the project root - depending on the build
* system, the path may need to be adjusted. For example, running the server.out in
* the cli requires no change, but running the server via jetbrains IDE's
* requires the path to be set to "../src/htdocs"
*/
#define DOCUMENT_ROOT "src/htdocs"
/**
* Maximum size of a request.
* By default, this is set to 8192 bytes (8KB). (reference:
* https://www.rfc-editor.org/rfc/rfc9110.html#section-4.1-5)
*/
#define HTTP_MAX_REQUEST_SIZE 8192
/**
* Default HTTP version used by the server for responses.
*/
#define HTTP_DEFAULT_VERSION "HTTP/1.1"
/**
* Route definitions.
*/
#define ROUTE_DEBUG "/debug"
#define ROUTE_DEFAULT_HOST "/default"
#define ROUTE_EXTERN_HOST "/extern"
#define ROUTE_INTERN_HOST "/intern"
/**
* Host definitions.
*/
#define HOST_INTERN "intern"
#define HOST_EXTERN "extern"
#endif