README.md
1# lws minimal http server deaddrop
2
3This demonstrates how you can leverage the lws deaddrop plugin to make a
4secure, modern html5 file upload and sharing application.
5
6The demo is protected by basic auth credentials defined in the file at
7./ba-passwords - by default the credentials are user: user1, password: password;
8and user: user2, password: password again.
9
10You can upload files and have them appear on a shared, downloadable list that
11is dynamically updated to all clients open on the page. Only the authenticated
12uploader is able to delete the files he uploaded.
13
14Multiple simultaneous ongoing file uploads are supported.
15
16## build
17
18To build this standalone, you must tell cmake where the lws source tree
19./plugins directory can be found, since it relies on including the source
20of the raw-proxy plugin.
21
22```
23 $ cmake . -DLWS_PLUGINS_DIR=~/libwebsockets/plugins && make
24```
25
26## usage
27
28```
29 $ ./lws-minimal-http-server-deaddrop
30[2018/12/01 10:31:09:7108] USER: LWS minimal http server deaddrop | visit https://localhost:7681
31[2018/12/01 10:31:09:8511] NOTICE: Creating Vhost 'default' port 7681, 1 protocols, IPv6 off
32[2018/12/01 10:31:09:8522] NOTICE: Using SSL mode
33[2018/12/01 10:31:10:0755] NOTICE: SSL ECDH curve 'prime256v1'
34[2018/12/01 10:31:10:2562] NOTICE: lws_tls_client_create_vhost_context: doing cert filepath localhost-100y.cert
35[2018/12/01 10:31:10:2581] NOTICE: Loaded client cert localhost-100y.cert
36[2018/12/01 10:31:10:2583] NOTICE: lws_tls_client_create_vhost_context: doing private key filepath
37[2018/12/01 10:31:10:2593] NOTICE: Loaded client cert private key localhost-100y.key
38[2018/12/01 10:31:10:2596] NOTICE: created client ssl context for default
39[2018/12/01 10:31:10:5290] NOTICE: deaddrop: vh default, upload dir ./uploads, max size 10000000
40[2018/12/01 10:31:10:5376] NOTICE: vhost default: cert expiry: 730203d
41...
42```
43
44Visit https://localhost:7681, and follow the link there to the secret area.
45
46Give your browser "user1" and "password" as the credentials. For testing to
47confirm what a different user sees, you can also log in as "user2" and
48"password".
49
50