Initial QUIC test.

This commit is contained in:
FireMasterK 2020-10-24 15:47:41 +00:00 committed by GitHub
parent ae3c8706d3
commit 27ffcc7eee
3 changed files with 291 additions and 0 deletions

33
main.go Normal file
View file

@ -0,0 +1,33 @@
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"github.com/lucas-clemente/quic-go/http3"
)
var hclient = &http.Client{
Transport: &http3.RoundTripper{},
}
func main() {
fmt.Println("Sending QUIC request to YouTube...")
resp, err := hclient.Get("https://www.youtube.com/")
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(body))
}