Fix multiple trackers

This commit is contained in:
xchacha20-poly1305
2025-04-03 20:01:08 +08:00
committed by 世界
parent f4c29840c3
commit 5eeef6b28e
4 changed files with 10 additions and 10 deletions

4
box.go
View File

@@ -257,7 +257,7 @@ func New(options Options) (*Box, error) {
if err != nil {
return nil, E.Cause(err, "create clash-server")
}
router.SetTracker(clashServer)
router.AppendTracker(clashServer)
service.MustRegister[adapter.ClashServer](ctx, clashServer)
services = append(services, clashServer)
}
@@ -267,7 +267,7 @@ func New(options Options) (*Box, error) {
return nil, E.Cause(err, "create v2ray-server")
}
if v2rayServer.StatsService() != nil {
router.SetTracker(v2rayServer.StatsService())
router.AppendTracker(v2rayServer.StatsService())
services = append(services, v2rayServer)
service.MustRegister[adapter.V2RayServer](ctx, v2rayServer)
}