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:
Robin Thellend
2025-07-07 04:41:23 -07:00
committed by GitHub
parent fd32cf5c69
commit 0a9c6ea4c8
18 changed files with 240 additions and 59 deletions

View File

@@ -18,7 +18,6 @@ import (
"golang.org/x/net/http/httpguts"
"github.com/quic-go/quic-go"
"github.com/quic-go/quic-go/internal/protocol"
)
// Settings are HTTP/3 settings that apply to the underlying connection.
@@ -146,7 +145,7 @@ func (t *Transport) init() error {
}
if len(t.QUICConfig.Versions) == 0 {
t.QUICConfig = t.QUICConfig.Clone()
t.QUICConfig.Versions = []quic.Version{protocol.SupportedVersions[0]}
t.QUICConfig.Versions = []quic.Version{quic.SupportedVersions()[0]}
}
if len(t.QUICConfig.Versions) != 1 {
return errors.New("can only use a single QUIC version for dialing a HTTP/3 connection")