Add NTP service
This commit is contained in:
@@ -34,7 +34,7 @@ type Shadowsocks struct {
|
||||
}
|
||||
|
||||
func NewShadowsocks(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.ShadowsocksOutboundOptions) (*Shadowsocks, error) {
|
||||
method, err := shadowimpl.FetchMethod(options.Method, options.Password)
|
||||
method, err := shadowimpl.FetchMethod(options.Method, options.Password, router.TimeFunc())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -74,6 +74,9 @@ func NewVMess(ctx context.Context, router adapter.Router, logger log.ContextLogg
|
||||
return nil, E.New("unknown packet encoding: ", options.PacketEncoding)
|
||||
}
|
||||
var clientOptions []vmess.ClientOption
|
||||
if timeFunc := router.TimeFunc(); timeFunc != nil {
|
||||
clientOptions = append(clientOptions, vmess.ClientWithTimeFunc(timeFunc))
|
||||
}
|
||||
if options.GlobalPadding {
|
||||
clientOptions = append(clientOptions, vmess.ClientWithGlobalPadding())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user