go-resty / resty

Simple HTTP and REST client library for Go
MIT License
10.01k stars 706 forks source link

Support HTTP3? #846

Closed tttturtle-russ closed 1 month ago

tttturtle-russ commented 1 month ago

It seems that resty v2 does not support HTTP3/QUIC. Are there any plans to support in v3?

jeevatkm commented 1 month ago

HTTP/3 can be used in Resty using the library https://github.com/quic-go/quic-go with https://pkg.go.dev/github.com/go-resty/resty/v2#Client.SetTransport

roundTripper := &http3.RoundTripper{
    TLSClientConfig: &tls.Config{},  // set a TLS client config, if desired
    QUICConfig:      &quic.Config{}, // QUIC connection options
}
defer roundTripper.Close()

restyClient := resty.New().SetTransport(roundTripper)

Reference: https://quic-go.net/docs/http3/client/