In the previous post, we saw how to write a simple websocat client for Mles. But how to run the server itself?
To run a server, you'll need to follow below steps:
- Acquire a public Internet server with a static IP + domain
- Open TLS port 443 of firewall
- Ensure that your wwwroot-directory has the static web pages under it e.g. static/your.domain
- Run Mles server as root (due to port 443) with Let's Encrypt caching and debug logging enabled as shown below
RUST_LOG=debug mles --domains your.domain --cache . --wwwroot static
You can have several domains listed e.g. --domains your.domain --domains www.your.domain
.
The full usage:
Usage: mles [OPTIONS] --domains --wwwroot
Options:
-d, --domains Domain(s)
-e, --email Contact info
-c, --cache Cache directory
-l, --limit History limit [default: 200]
-w, --wwwroot Www-root directory for domain(s) (e.g. /path/static where domain mles.io goes to static/mles.io)
-s, --staging Use Let's Encrypt staging environment (see https://letsencrypt.org/docs/staging-environment/)
-p, --port [default: 443]
-h, --help Print help
It is out already in crates.io mles v2.0.0, let me know how it works for you. Enjoy!