Hold Go's server privately in waf.Server and rproxy.Server (closes #437)
check / check (push) Failing after 1m42s

Neither Server embeds *http.Server any more. Each holds it as a private
field, is its handler, and has Serve, Shutdown, Close and ServeHTTP.
sww's serve hook takes the new daemonServer interface of those first
three, and fx provides each Server as it.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-20 00:33:14 +00:00
1 parent cc77435f2a
commit ad7ea4608b
15 files changed
+134 -54

No files matched your search

+7 -3
View File
@@ -4,7 +4,6 @@ import (
"context"
"log/slog"
"net"
"net/http"
"os"
"go.uber.org/fx"
@@ -44,8 +43,13 @@ func RunRProxy(ctx context.Context, params Params) int {
app := fx.New(
fx.Supply(cfg, processLog, requestLog{params.Stdout}, failed),
fx.Provide(
newRProxyServer,
func(server *rproxy.Server) *http.Server { return server.Server },
// run waits for rproxy.Server's reports, and serve takes it as a
// daemonServer.
fx.Annotate(
newRProxyServer,
fx.As(fx.Self()),
fx.As(new(daemonServer)),
),
newRProxyListener,
),
fx.Invoke(serve),