h3

package
v0.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransport

func NewTransport(qc *quic.Config) *ech.Transport

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL