Fix time service

This commit is contained in:
世界
2024-12-14 22:41:58 +08:00
parent 0838d6e7a8
commit 0c61ee34f5
2 changed files with 34 additions and 4 deletions

View File

@@ -0,0 +1,22 @@
package tls
import (
"time"
"github.com/sagernet/sing/common/ntp"
)
type TimeServiceWrapper struct {
ntp.TimeService
}
func (w *TimeServiceWrapper) TimeFunc() func() time.Time {
if w.TimeService == nil {
return nil
}
return w.TimeService.TimeFunc()
}
func (w *TimeServiceWrapper) Upstream() any {
return w.TimeService
}