The HTTP server answers incoming requests by executing built-in modules. The request forms a so-called session and the modules are asked wether they can handle the session. If so, the module is responsible for sending an appropriate response back to the HTTP client. If a module is unable to handle the session, the next module is asked.
Once a module is found it is bound to the session and reexecuted whenever some of the data has been sent, so that the module can continue sending data.
When the complete response was generated, the module has to close the session and the HTTP connection will be shut down.
Files | |
file | httpd.c |
HTTP server main implementation (license: GPLv2). | |
file | httpd.h |
HTTP server main header (license: GPLv2). | |
file | httpd_modules.c |
HTTP server module implementations (license: GPLv2). | |
file | httpd_modules.h |
HTTP server modules header (license: GPLv2). | |
file | httpd_session.c |
HTTP server session layer implementation (license: GPLv2). | |
file | httpd_session.h |
HTTP server session layer header (license: GPLv2). | |
Modules | |
HTTP server configuration | |
Functions | |
bool | httpd_init (uint16_t port) |
Starts the HTTP server. |
bool httpd_init | ( | uint16_t | port | ) |
Starts the HTTP server.
The server starts listening on the specified TCP port.
[in] | port | The port on which to listen for HTTP requests. |
true
on success, false
on failure.