mirror of
https://github.com/TeamPiped/http3-ytproxy.git
synced 2024-08-14 23:56:43 +00:00
Initial QUIC test.
This commit is contained in:
parent
ae3c8706d3
commit
27ffcc7eee
3 changed files with 291 additions and 0 deletions
33
main.go
Normal file
33
main.go
Normal 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))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue