From d9e2335ddaaaa905dc261d442acdd2e86dfdb345 Mon Sep 17 00:00:00 2001 From: Christopher Lamb <37453482+lambchr@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:00:44 +0100 Subject: [PATCH] add NTPAddr override --- session.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/session.go b/session.go index 9bbf214..2608907 100644 --- a/session.go +++ b/session.go @@ -52,6 +52,7 @@ type Session struct { type SessionOptions struct { TLSConfig *tls.Config // TLS configuration for NTS key exchange, only used in the defaultDialer Dialer func(network, addr string) (*tls.Conn, error) // Dialer returns a net.Conn that has completed a TLS handshake, if nil the defaultDialer is used + NTPAddr string // NTPAddr overrides the NTP address discovered from the NTS connection, this can be used with the custom Dialer when traversing a proxy } // NewSession creates an NTS session by connecting to an NTS key-exchange @@ -89,6 +90,10 @@ func NewSessionWithOptions(address string, opt *SessionOptions) (*Session, error if err != nil { return nil, err } + + if opt.NTPAddr != "" { + s.ntpAddr = opt.NTPAddr + } return s, nil }