Просмотр исходного кода

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 <[email protected]>
copilot-swe-agent[bot] 2 недель назад
Родитель
Сommit
2d37e84d4d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      proxy/wireguard/client.go

+ 1 - 1
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,
 	}