mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-18 10:39:09 +03:00
15 lines
343 B
Go
15 lines
343 B
Go
package conntrack
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/sagernet/sing/service"
|
|
)
|
|
|
|
func ContextWithDefaultTracker(ctx context.Context, killerEnabled bool, memoryLimit uint64) context.Context {
|
|
if service.FromContext[Tracker](ctx) != nil {
|
|
return ctx
|
|
}
|
|
return service.ContextWith[Tracker](ctx, NewDefaultTracker(killerEnabled, memoryLimit))
|
|
}
|