diff --git a/internal/netxlite/http3.go b/internal/netxlite/http3.go index dcc667bc87..f31ffcdc6d 100644 --- a/internal/netxlite/http3.go +++ b/internal/netxlite/http3.go @@ -64,13 +64,20 @@ func NewHTTP3Transport( // NewHTTP3TransportStdlib creates a new HTTPTransport using http3 that // uses standard functionality for everything but the logger. -func NewHTTP3TransportStdlib(logger model.DebugLogger) model.HTTPTransport { - ql := NewUDPListener() - reso := NewStdlibResolver(logger) - qd := NewQUICDialerWithResolver(ql, logger, reso) +func (netx *Netx) NewHTTP3TransportStdlib(logger model.DebugLogger) model.HTTPTransport { + ql := netx.NewUDPListener() + reso := netx.NewStdlibResolver(logger) + qd := netx.NewQUICDialerWithResolver(ql, logger, reso) return NewHTTP3Transport(logger, qd, nil) } +// NewHTTP3TransportStdlib is equivalent to creating an empty [*Netx] +// and calling its NewHTTP3TransportStdlib method. +func NewHTTP3TransportStdlib(logger model.DebugLogger) model.HTTPTransport { + netx := &Netx{Underlying: nil} + return netx.NewHTTP3TransportStdlib(logger) +} + // NewHTTPTransportWithResolver creates a new HTTPTransport using http3 // that uses the given logger and the given resolver. func NewHTTP3TransportWithResolver(logger model.DebugLogger, reso model.Resolver) model.HTTPTransport { diff --git a/internal/netxlite/netx.go b/internal/netxlite/netx.go index 1c6fec8c14..67e30e830b 100644 --- a/internal/netxlite/netx.go +++ b/internal/netxlite/netx.go @@ -21,12 +21,3 @@ type Netx struct { func (netx *Netx) maybeCustomUnderlyingNetwork() *MaybeCustomUnderlyingNetwork { return &MaybeCustomUnderlyingNetwork{netx.Underlying} } - -// NewHTTP3TransportStdlib is like [netxlite.NewHTTP3TransportStdlib] but the constructed [model.HTTPTransport] -// uses the [model.UnderlyingNetwork] configured inside the [Netx] structure. -func (n *Netx) NewHTTP3TransportStdlib(logger model.DebugLogger) model.HTTPTransport { - ql := n.NewUDPListener() - reso := n.NewStdlibResolver(logger) - qd := n.NewQUICDialerWithResolver(ql, logger, reso) - return NewHTTP3Transport(logger, qd, nil) -}