aboutsummaryrefslogtreecommitdiff
path: root/examples/headers/README.md
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-11-18 00:56:04 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-11-18 01:03:12 +0100
commit65031ca3502e0c27780be847fd97c112546741a9 (patch)
tree31c8ac5bb815baf5e4b63bde3af9076eb30a30ed /examples/headers/README.md
parentb71a6174e12b4709acaf8bc151938ba12d2a54f6 (diff)
downloadlibweb-65031ca3502e0c27780be847fd97c112546741a9.tar.gz
Send HTTP headers to payload callback
Even if libweb already parses some common headers, such as Content-Length, some users might find it interesting to inspect which headers were received from a request. Since HTTP/1.1 does not define a limit on the number of maximum headers a client can send, for security reasons a maximum value must be provided by the user. Any extra headers shall be then discarded by libweb. An example application showing this new feature is also provided.
Diffstat (limited to 'examples/headers/README.md')
-rw-r--r--examples/headers/README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/headers/README.md b/examples/headers/README.md
new file mode 100644
index 0000000..01c243a
--- /dev/null
+++ b/examples/headers/README.md
@@ -0,0 +1,16 @@
+# HTTP headers example
+
+This example shows a HTTP/1.1 server that listens to port `8080` and prints
+the headers received from the client (up to a maximum of `max_headers`) to
+standard output.
+
+## How to build
+
+If using `make(1)`, just run `make` from this directory.
+
+If using CMake, examples are built by default when configuring the project
+from [the top-level `CMakeLists.txt`](../../CMakeLists.txt).
+
+## How to run
+
+Run the executable without any command line arguments.