diff --git a/CLAUDE.md b/CLAUDE.md
index a271fd0..c6953f3 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -11,7 +11,7 @@ llama-swap is a light weight, transparent proxy server that provides automatic m
## Testing
-- `make test-dev` - Use this when making iterative changes. Runs `go test` and `staticcheck`. Fix any static checking errors.
+- `make test-dev` - Use this when making iterative changes. Runs `go test` and `staticcheck`. Fix any static checking errors. Use this only when changes are made to any code under the `proxy/` directory
- `make test-all` - runs at the end before completing work. Includes long running concurrency tests.
## Workflow Tasks
diff --git a/cmd/wol-proxy/index.html b/cmd/wol-proxy/index.html
new file mode 100644
index 0000000..3bbf9be
--- /dev/null
+++ b/cmd/wol-proxy/index.html
@@ -0,0 +1,64 @@
+
+
+
+
+Loading...
+
+
+
+
+
Waking up upstream server...
+
+
+
+
+
diff --git a/cmd/wol-proxy/wol-proxy.go b/cmd/wol-proxy/wol-proxy.go
index 52e1c26..1443f55 100644
--- a/cmd/wol-proxy/wol-proxy.go
+++ b/cmd/wol-proxy/wol-proxy.go
@@ -3,6 +3,7 @@ package main
import (
"bufio"
"context"
+ _ "embed"
"errors"
"flag"
"fmt"
@@ -19,6 +20,9 @@ import (
"time"
)
+//go:embed index.html
+var loadingPageHTML string
+
var (
flagMac = flag.String("mac", "", "mac address to send WoL packet to")
flagUpstream = flag.String("upstream", "", "upstream proxy address to send requests to")
@@ -230,6 +234,15 @@ func (p *proxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if err := sendMagicPacket(*flagMac); err != nil {
slog.Warn("failed to send magic WoL packet", "error", err)
}
+
+ // For root path requests, return loading page with status polling
+ if path == "/" {
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ w.WriteHeader(http.StatusOK)
+ fmt.Fprint(w, loadingPageHTML)
+ return
+ }
+
ticker := time.NewTicker(250 * time.Millisecond)
timeout, cancel := context.WithTimeout(context.Background(), time.Duration(*flagTimeout)*time.Second)
defer cancel()