Name Date Size #Lines LOC

..--

mount-origin/H25-Apr-2025-157150

mount-secret-origin/H25-Apr-2025-7975

CMakeLists.txtH A D25-Apr-2025797 2621

README.mdH A D25-Apr-2025868 3522

ba-passwordsH A D25-Apr-202514 21

minimal-http-server-basicauth.cH A D25-Apr-20253.2 KiB11474

README.md

1# lws minimal http server basic auth
2
3This demonstrates how to protect a mount using a password
4file outside of the mount itself.
5
6The demo has two mounts, a normal one at / and one protected
7by basic auth at /secret.
8
9The file at ./ba-passwords contains valid user:password
10combinations.
11
12## Discovering the authenticated user
13
14After a successful authentication, the `WSI_TOKEN_HTTP_AUTHORIZATION` token
15contains the authenticated username.
16
17## build
18
19```
20 $ cmake . && make
21```
22
23## usage
24
25```
26 $ ./lws-minimal-http-server-basic-auth
27[2018/04/19 08:40:05:1333] USER: LWS minimal http server basic auth | visit http://localhost:7681
28[2018/04/19 08:40:05:1333] NOTICE: Creating Vhost 'default' port 7681, 1 protocols, IPv6 off
29```
30
31Visit http://localhost:7681, and follow the link there to the secret area.
32
33Give your browser "user" and "password" as the credentials.
34
35