forked from quic-go/quic-go
http3: remove dependency on quic internal packages (#5256)
* Remove http3 dependency on quic internal packages Remove the dependency on internal/protocol from the http3 package. This makes it possible for a forked http3 to use the mainline quic-go package. * Address review comments * Fix syntax * Use broader pattern for http3 directory * Copy internal/testdata * Replace perspective with bool * clone the supported version slice --------- Co-authored-by: Marten Seemann <martenseemann@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"net"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"github.com/quic-go/quic-go/internal/handshake"
|
||||
@@ -25,6 +26,12 @@ const (
|
||||
Version2 = protocol.Version2
|
||||
)
|
||||
|
||||
// SupportedVersions returns the support versions, sorted in descending order of preference.
|
||||
func SupportedVersions() []Version {
|
||||
// clone the slice to prevent the caller from modifying the slice
|
||||
return slices.Clone(protocol.SupportedVersions)
|
||||
}
|
||||
|
||||
// A ClientToken is a token received by the client.
|
||||
// It can be used to skip address validation on future connection attempts.
|
||||
type ClientToken struct {
|
||||
|
||||
Reference in New Issue
Block a user