fix: print the actual address listened on

This is useful when the server is started with an ephemeral port, e.g.:

./rest-server --no-auth --listen "127.0.0.1:0"

...

start server on 127.0.0.1:46015
This commit is contained in:
Adam Eijdenberg
2024-01-19 12:09:13 +11:00
parent 3ce6aaf2b6
commit 03ad2420db
3 changed files with 19 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
Enhancement: after start-up, server served message now prints actual listen address
For example, when started with `--listen :0`, previously the server would print:
```
start server on :0
```
Now it will print the actual address listened on, e.g.
```
start server on 0.0.0.0:37333
```
This is useful when starting a server with an auto-allocated free port number (port 0).
https://github.com/restic/rest-server/pull/271