From 4ccd1a282ae751e24a44283018e149544cd2500e Mon Sep 17 00:00:00 2001 From: ruben Date: Wed, 9 Feb 2022 22:45:12 +0100 Subject: [PATCH] adding a quickstart guide --- examples/readme.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/readme.md diff --git a/examples/readme.md b/examples/readme.md new file mode 100644 index 00000000..103196c0 --- /dev/null +++ b/examples/readme.md @@ -0,0 +1,35 @@ +# Getting started +This is a quick starting guide to run the example. + +## Start the Server +To start the example server you can run following command: + +```bash +> cargo run --example server -- --listen=127.0.0.1:4433 +``` + +This will start an the HTTP/3 server, listening to 127.0.0.1 on port 4433. +This also generates a self-signed certificate for encryption. + +## Start the client +To start the example client you can run following command: + +```bash +> cargo run --example client -- https://localhost:4433 --insecure=true +``` + +This sends an HTTP request to the server. +The `--insecure=true` allows the client to accept invalid certificates like the self-signed, which the server has created. + +## Add some content to the Server +So that the server responds something you can provide a directory with content files. + +```bash +> cargo run --example server -- --listen=127.0.0.1:4433 --dir=content/root +``` + +To start the client simply put the file name behind the URI: + +```bash +> cargo run --example client -- https://localhost:4433/index.html --insecure=true +``` \ No newline at end of file