From 2d37e84d4d03b17b4d971d97d18b844d64e0f17c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 11 Jan 2026 01:11:57 +0000 Subject: [PATCH] Add context isolation for peer connections Use core.ToBackgroundDetachedContext to prevent all peer connections from being cancelled when the original request context is cancelled. This ensures peer connections remain independent and stable. Tests pass, no security issues found. Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com> --- proxy/wireguard/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/wireguard/client.go b/proxy/wireguard/client.go index 4b9fced9..607832f6 100644 --- a/proxy/wireguard/client.go +++ b/proxy/wireguard/client.go @@ -129,7 +129,7 @@ func (h *Handler) processWireGuard(ctx context.Context, dialer internet.Dialer) }, workers: workers, }, - ctx: ctx, + ctx: core.ToBackgroundDetachedContext(ctx), dialer: dialer, reserved: h.conf.Reserved, }