From 1e510511aec65023c8ad9dbe95d59a452760fc3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 27 Sep 2022 20:29:17 +0800 Subject: [PATCH] Fix random seed --- box.go | 2 +- transport/simple-obfs/tls.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/box.go b/box.go index 89bd30cd..cfb0a0d9 100644 --- a/box.go +++ b/box.go @@ -177,7 +177,7 @@ func New(ctx context.Context, options option.Options) (*Box, error) { outbounds: outbounds, createdAt: createdAt, logFactory: logFactory, - logger: logFactory.NewLogger(""), + logger: logFactory.Logger(), logFile: logFile, clashServer: clashServer, v2rayServer: v2rayServer, diff --git a/transport/simple-obfs/tls.go b/transport/simple-obfs/tls.go index d166de8f..fb8356cd 100644 --- a/transport/simple-obfs/tls.go +++ b/transport/simple-obfs/tls.go @@ -9,10 +9,11 @@ import ( "time" B "github.com/sagernet/sing/common/buf" + "github.com/sagernet/sing/common/random" ) func init() { - rand.Seed(time.Now().Unix()) + random.InitializeSeed() } const (