https://github.com/samicpp/muon
A rust webserver built for ease of use, configurability, and speed
https://github.com/samicpp/muon
http http-server http1 http2 http2-server rust tls tls-support webserver
Last synced: 9 days ago
JSON representation
A rust webserver built for ease of use, configurability, and speed
- Host: GitHub
- URL: https://github.com/samicpp/muon
- Owner: samicpp
- License: gpl-3.0
- Created: 2026-03-15T12:52:09.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-06-10T11:58:10.000Z (11 days ago)
- Last Synced: 2026-06-10T13:22:33.140Z (11 days ago)
- Topics: http, http-server, http1, http2, http2-server, rust, tls, tls-support, webserver
- Language: Rust
- Homepage:
- Size: 330 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# muon
A rust webserver built for ease of use, and speed
## Crate features
| feature | requires | desciption |
|--------------|----------|----------------------------------|
| unix-sockets | - | enables unix sockets |
| ring | - | uses ring provider |
| aws-lc-rs | - | uses aws provider |
| simple | - | enables the simple handler |
| samicpp | - | enables the samicpp handler |
## Usage
muon tries to read a file named `settings.toml` from the directory its executable lies.
Alternatively a different file can be specified with cli argument `--settings ./path/to/file.toml`
## Handlers
| handler | description |
|---------|---------------------------------|
| simple | a simple static content handler |
| samicpp | a handler with all of my needs |
If you need a specific handler open an issue and i can make one named after you,
or fork the repo and open a pull request.
## TODO::Features
- [x] support TLS
- [x] TLS certificate selection
- [x] add loglevels based on individual logs
- [x] add simple handler
- [x] support multiple different addresses in same field
- [x] allow customizing tokio runtime
- [x] support cli arguments
- [x] support HTTP/2 and h2c
- [x] rework logging
- [ ] support HTTP/1.1 pipelining
- [ ] advanced socket options with socket2
- [ ] colorize log output
- [ ] allow exporting/sending server connection data
- [ ] create runtime stdin console
- [ ] allow reloading settings file
- [ ] enable loading FFI modules
- [ ] support forwarding the request by proxying
## TODO::Features::SamicppHandler
- [x] support serving files
- [x] support partial content
- [x] support redirect, var, and link files
- [x] support download files
- [x] support route level auth
- [x] support FFI handler endpoints
- [ ] embed Deno engine to execute javascript
- [ ] allow stopping the servers / listeners
- [ ] embed rhai
- [ ] make some built in method of making services through data driven behaviour
## Examples
settings.toml
```toml
[network]
address = [
"http://0.0.0.0:8001",
"https://0.0.0.0:8002",
]
default_key = "./tls/localhost-key.pem"
default_cert = "./tls/localhost.pem"
alpn = [ "h2", "http/1.1" ]
[[network.sni]]
domain = "one.localhost"
key = "./tls/one.localhost-key.pem"
cert = "./tls/one.localhost.pem"
[[network.sni]]
domain = "two.localhost"
key = "./tls/two.localhost-key.pem"
cert = "./tls/two.localhost.pem"
[[network.binding]]
address = "httpx://0.0.0.0:2233"
backlog = 1
[environment]
cwd = "/var/www"
[content]
handler = "simple"
max_file_size = 16777216 # 16mb
serve_dir = "public"
[logging]
```