Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTransport ¶
NewTransport returns a ech.Transport that is ready to be used with [http.Client]. This Transport uses the HTTP/3 protocol with the hostname has a HTTPS RR with h3 in its ALPN list.
Example ¶
url := "https://private.example.com"
transport := NewTransport(&quic.Config{})
transport.Dialer.RequireECH = true
transport.TLSConfig = &tls.Config{
NextProtos: []string{
"h3",
},
}
client := &http.Client{Transport: transport}
resp, err := client.Get(url)
if err != nil {
log.Fatalf("%q: %v", url, err)
}
defer resp.Body.Close()
fmt.Printf("==== %s Status:%d ====\n", url, resp.StatusCode)
io.Copy(os.Stdout, resp.Body)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.