Skip to content

Commit 4ccd1a2

Browse files
Ruben2424seanmonstar
authored andcommitted
adding a quickstart guide
1 parent 28c490f commit 4ccd1a2

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

examples/readme.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Getting started
2+
This is a quick starting guide to run the example.
3+
4+
## Start the Server
5+
To start the example server you can run following command:
6+
7+
```bash
8+
> cargo run --example server -- --listen=127.0.0.1:4433
9+
```
10+
11+
This will start an the HTTP/3 server, listening to 127.0.0.1 on port 4433.
12+
This also generates a self-signed certificate for encryption.
13+
14+
## Start the client
15+
To start the example client you can run following command:
16+
17+
```bash
18+
> cargo run --example client -- https://localhost:4433 --insecure=true
19+
```
20+
21+
This sends an HTTP request to the server.
22+
The `--insecure=true` allows the client to accept invalid certificates like the self-signed, which the server has created.
23+
24+
## Add some content to the Server
25+
So that the server responds something you can provide a directory with content files.
26+
27+
```bash
28+
> cargo run --example server -- --listen=127.0.0.1:4433 --dir=content/root
29+
```
30+
31+
To start the client simply put the file name behind the URI:
32+
33+
```bash
34+
> cargo run --example client -- https://localhost:4433/index.html --insecure=true
35+
```

0 commit comments

Comments
 (0)