forked from quic-go/quic-go
add a -tls flag to the example client and server
This will add the WIP TLS version as the preferred supported version. It is intended for developing and testing of IETF QUIC.
This commit is contained in:
@@ -7,12 +7,15 @@ import (
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
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/utils"
|
||||
)
|
||||
|
||||
func main() {
|
||||
verbose := flag.Bool("v", false, "verbose")
|
||||
tls := flag.Bool("tls", false, "activate support for IETF QUIC (work in progress)")
|
||||
flag.Parse()
|
||||
urls := flag.Args()
|
||||
|
||||
@@ -23,8 +26,15 @@ func main() {
|
||||
}
|
||||
utils.SetLogTimeFormat("")
|
||||
|
||||
versions := protocol.SupportedVersions
|
||||
if *tls {
|
||||
versions = append([]protocol.VersionNumber{protocol.VersionTLS}, versions...)
|
||||
}
|
||||
|
||||
hclient := &http.Client{
|
||||
Transport: &h2quic.RoundTripper{},
|
||||
Transport: &h2quic.RoundTripper{
|
||||
QuicConfig: &quic.Config{Versions: versions},
|
||||
},
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
Reference in New Issue
Block a user