From 285778b6467a6297e20c2a1ad82b34a3dd6eeb03 Mon Sep 17 00:00:00 2001 From: Razvan Dimescu Date: Sat, 21 Mar 2026 04:31:17 +0200 Subject: [PATCH] add styled 404 page for unregistered .numa domains Roman Stone themed 404 with Instrument Serif heading, JetBrains Mono domain badge, brick pattern background, syntax-highlighted curl example, and a delayed easter egg. Also updates dashboard link in README to numa.numa. Co-Authored-By: Claude Opus 4.6 --- README.md | 2 +- src/proxy.rs | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 114 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d67cf10..600ee17 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ dig @127.0.0.1 google.com # ✓ resolves normally dig @127.0.0.1 ads.google.com # ✗ blocked → 0.0.0.0 ``` -Open the dashboard: **http://localhost:5380** +Open the dashboard: **http://numa.numa** (or `http://localhost:5380`) Or build from source: ```bash diff --git a/src/proxy.rs b/src/proxy.rs index 787bbf9..761a0d1 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -141,9 +141,120 @@ async fn proxy_handler(State(state): State, req: Request) -> axum::r Some(entry) => entry.target_port, None => { return ( - StatusCode::BAD_GATEWAY, + StatusCode::NOT_FOUND, + [(hyper::header::CONTENT_TYPE, "text/html; charset=utf-8")], format!( - "unknown service: {}{}", + r##" + +404 — {0}{1} + + + + +
+
404
+
{0}{1}
+

This service isn't registered yet.
Add it from the dashboard or:

+
$ curl -X POST numa.numa:5380/services \
+    -H 'Content-Type: application/json' \
+    -d '{{"name":"{0}","target_port":3000}}'
+
ma-ia hii, ma-ia huu, ma-ia haa, ma-ia ha-ha
+
+"##, service_name, state.ctx.proxy_tld_suffix ), ) -- 2.34.1