use the quic.Config to set the QUIC version in the Chrome tests

This commit is contained in:
Marten Seemann
2017-08-23 10:20:56 +07:00
parent 5751b599ee
commit 17a0541edb
5 changed files with 17 additions and 12 deletions

View File

@@ -7,7 +7,9 @@ import (
"net/http"
"strconv"
quic "github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/h2quic"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/testdata"
. "github.com/onsi/ginkgo"
@@ -75,11 +77,16 @@ func GeneratePRData(l int) []byte {
return res
}
func StartQuicServer() {
// StartQuicServer starts a h2quic.Server.
// versions is a slice of supported QUIC versions. It may be nil, then all supported versions are used.
func StartQuicServer(versions []protocol.VersionNumber) {
server = &h2quic.Server{
Server: &http.Server{
TLSConfig: testdata.GetTLSConfig(),
},
QuicConfig: &quic.Config{
Versions: versions,
},
}
addr, err := net.ResolveUDPAddr("udp", "0.0.0.0:0")