1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/index.html
Andy Green 986bb37c88 ah: custom headers for h1
Until now lws only parses headers it knows at build-time from its
prebuilt lexical analyzer.

This adds an on-by-default cmake option and a couple of apis
to also store and query "custom", ie, unknown-to-lws headers.

A minimal example is also provided.

At the moment it only works on h1, h2 support needs improvements
to the hpack implementation.

Since it bloats ah memory usage compared to without it if custom
headers are present, the related code and ah footprint can be
disabled with the cmake option LWS_WITH_CUSTOM_HEADERS, but it's
on by default normally.  ESP32 platform disables it.

https://github.com/warmcat/libwebsockets/pull/1499
2019-03-10 08:02:02 +08:00

20 lines
623 B
HTML

<html>
<head>
<meta charset=utf-8 http-equiv="Content-Language" content="en"/>
</head>
<body>
<img src="libwebsockets.org-logo.svg">
<img src="strict-csp.svg"><br>
Hello from the <b>minimal http server custom headers example</b>.
<p>
The idea is it will tell you what your browser sent for DNT, a header lws doesn't already know.
<p>
At the moment the custom header api only works on h1.
<p>
<a href="http://127.0.0.1:7681/dyn/xxx" >Show DNT header using h1 over http</a><br>
<a href="https://127.0.0.1:7682/dyn/xxx" >Show DNT header using h1 (h2 if enabled) over https</a><br>
</body>
</html>