aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-03-18 11:28:59 +0100
committermetamuffin <metamuffin@disroot.org>2025-03-18 11:28:59 +0100
commit284254f9cb257bc52cebf3f0a60229f4406b8c02 (patch)
tree2c89afe866dad143545f589e6b8b4cd26cb14f72
parentd3c1805fadc6cd7c0926d1b22dffe0b58d25c207 (diff)
downloadgnix-284254f9cb257bc52cebf3f0a60229f4406b8c02.tar
gnix-284254f9cb257bc52cebf3f0a60229f4406b8c02.tar.bz2
gnix-284254f9cb257bc52cebf3f0a60229f4406b8c02.tar.zst
update readme
-rw-r--r--readme.md4
-rw-r--r--src/main.rs12
2 files changed, 8 insertions, 8 deletions
diff --git a/readme.md b/readme.md
index 03bdbc5..2e6e983 100644
--- a/readme.md
+++ b/readme.md
@@ -4,8 +4,8 @@ a simple stupid reverse proxy
## Features
-- HTTP/1.1 and HTTP/2
-- Simple to configure (see below)
+- HTTP/1.1, HTTP/2 and HTTP/3 support by default
+- Simple and predictable configuration (see below)
- Somewhat fast (about 150k req/s on a rpi5 for simple routes)
- Composable modules
- Handles connection upgrades correctly by default (websocket, etc.)
diff --git a/src/main.rs b/src/main.rs
index 31f8db7..9f7ba22 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -140,7 +140,7 @@ async fn serve_http(state: Arc<State>) -> Result<()> {
let listen_futs: Result<Vec<()>> = try_join_all(http_config.bind.iter().map(|e| async {
let l = TcpListener::bind(*e).await?;
let listen_addr = l.local_addr()?;
- info!("HTTP listener bound to {}", l.local_addr().unwrap());
+ info!("HTTP listener bound to {}/tcp", l.local_addr().unwrap());
loop {
let (stream, addr) = l.accept().await.context("accepting connection")?;
debug!("connection from {addr}");
@@ -152,9 +152,6 @@ async fn serve_http(state: Arc<State>) -> Result<()> {
}
}))
.await;
-
- info!("serving http");
-
listen_futs?;
Ok(())
}
@@ -177,7 +174,10 @@ async fn serve_https(state: Arc<State>) -> Result<()> {
let listen_futs: Result<Vec<()>> = try_join_all(https_config.bind.iter().map(|e| async {
let l = TcpListener::bind(*e).await?;
let listen_addr = l.local_addr()?;
- info!("HTTPS listener bound to {}", l.local_addr().unwrap());
+ info!(
+ "HTTPS (h1+h2) listener bound to {}/tcp",
+ l.local_addr().unwrap()
+ );
loop {
let (stream, addr) = l.accept().await.context("accepting connection")?;
let state = state.clone();
@@ -220,7 +220,7 @@ async fn serve_h3(state: Arc<State>) -> Result<()> {
let cfg = quinn::ServerConfig::with_crypto(cfg.clone());
let endpoint = quinn::Endpoint::server(cfg, *listen_addr)?;
let listen_addr = *listen_addr;
- info!("HTTPS (h3) listener bound to {listen_addr}");
+ info!("HTTPS (h3) listener bound to {listen_addr}/udp");
while let Some(conn) = endpoint.accept().await {
let state = state.clone();
tokio::spawn(async move {