Skip to content

Releases: quic-go/quic-go

v0.35.0

30 May 07:15
fce0261
Compare
Choose a tag to compare

Modernizing the quic-go connection API

In this release, we've completely revamped our connection establishment API, following an engaging discussion with the quic-go community (#3727).

Key modifications are as follows:

  • The context variants of the dial functions, including DialContext, have been removed. In their place, Dial now incorporates a context. This development stems from our drive to modernize the API, given that context.Context wasn't in existence when quic-go was launched eight years ago.
  • quic.Listener and quic.EarlyListener have transitioned from interfaces to structs.
  • We've introduced a quic.Transport. More about that below.

Introducing the Transport

The QUIC protocols demultiplexes connections based on the QUIC Connection IDs. This has interesting implications, first and foremost that multiple QUIC connections can run on the same UDP socket (and even connect to the same remote QUIC server). Interestingly, it's feasible to run a QUIC server on the same socket as outgoing QUIC connections. In fact, that's a really useful thing to do when using QUIC for holepunching through NATs.

Previously, it was possible to utilize this feature, but the API lacked clarity. When the same net.PacketConn was passed to sequential Listen and Dial calls, quic-go would identify this and multiplex several QUIC connections on that net.PacketConn. This behavior was not obvious and, additionally, it demanded that certain values of the Config matched.

We've now made multiplexing explicit with the Transport introduction. A Transport manages a single net.PacketConn. The usage is as follows:

laddr, err := net.ResolveUDPAddr("udp4", "0.0.0.0:443")
// handle err
conn, err := net.ListenUDP("udp4", laddr)
// handle err
tr := quic.Transport{
	Conn:              conn,
	StatelessResetKey: <a key that survives reboots>,
}
// start listening for incoming QUIC connection
ln, err := tr.Listen(<tls.Config>, &quic.Config{})
// handle err
go func() {
	conn, err := ln.Accept(context.Background())
	if err != nil {
		return
	}
	// handle accepted QUIC connection...
}()

// establish QUIC connections to remote nodes, on the same UDP socket
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel
conn, err := tr.Dial(ctx, <remote addr>, <tls.Config>, <quic.Config>)
// handle err
// handle dialed QUIC connection

This modification enables us to shift several configuration options logically tied to the UDP sockets from the Config. Specifically, ConnectionIDLength / ConnectionIDGenerator and StatelessResetKey are now configured on the Transport.

Migration Guide

To update to the new version, applications might need to:

  1. Substitute calls to DialContext with calls to Dial.
  2. Replace all instances of Listener with *Listener (and similarly for EarlyListener).

Other Notable Changes

  • The HTTP/3 response writer is now compatible with the http.ResponseController introduced in the Go 1.20 release (#3790). Thanks @dunglas!
  • The http3.RoundTripper now implements CloseIdleConnections method, allowing the use of http.Client.CloseIdleConnections. Thanks @Glonee!
  • DoS resiliency was improved by only using a single Go routine to send stateless reset, version negotiation and INVALID_TOKEN error packets (#3842 and #3854). Thanks @sukunrt!
  • We now use the SO_RCVBUFFORCE syscall to attempt to increase the UDP receive buffer. Increasing the receive buffer is absolutely crucial for QUIC performance, and quic-go will print a log message if increasing the buffer size fails. Unfortunately, due to small default buffer sizes in most Linux distributions, this happened quite frequently and required manual configuration(https://github.com/quic-go/quic-go/wiki/UDP-Receive-Buffer-Size). Using SO_RCVBUFFORCE call will only succeed when the process has CAP_NET_ADMIN permissions, but in these cases no manual configuration will be necessary any more. Thanks to @MarcoPolo!

Full Changelog

New Contributors

Full Changelog: v0.34.0...v0.35.0

v0.34.0

20 Apr 09:55
4a2a574
Compare
Choose a tag to compare

Breaking Changes

  • Connection.HandshakeComplete now returns a channels instead of a context.Context

Other notable Changes

  • The QUIC version in use is now attached to the context returned from ClientHelloInfo.Context() in tls.Config.GetConfigForClient (#3721)
  • The http3.RoundTripper now multiplexes all connections on a single UDPConn (#3720)

What's Changed

New Contributors

Full Changelog: v0.33.0...v0.34.0

v0.33.0

22 Feb 06:00
a92238b
Compare
Choose a tag to compare

Breaking Changes

Very minimal breaking changes this time. We've deprecated quicvarint.Write (use quicvarint.Append instead). We've also removed support for Go 1.18 (we now only support Go 1.19 and 1.20).

Notable Improvements

  • HTTP/3: Content Type Sniffing: #3715
  • QUIC v2: fix code point of the TLS extension: #3710
  • HTTP/3: fix race when accessing the client's connection: #3696
  • reduce the size of the message channel in the crypto setup (from 100 to 1): #3664
  • refactor the datagram queue to not use a channel (of capacity 100): #3664

Changelog

New Contributors

Full Changelog: v0.32.0...v0.33.0

v0.32.0

02 Feb 07:08
1cea56a
Compare
Choose a tag to compare

Breaking Changes

quic-go has moved from the private GitHub account of lucas-clemente to a dedicated org, quic-go. Now all the QUIC-related repositories (the various qtls forks of crypto/tls, our QPACK implementation, webtransport-go etc.) are now all located under this org. Note that this will require users to update the import path in go.mod as well as in Go files. The new import path is github.com/quic-go/quic-go.

Notable Changes

  • We now have support for Go 1.20, which was released earlier today.
  • This release dramatically reduces the number of allocations that happen when transferring large amount of data on a stream. This is the result of a large effort to reduce and amortize allocations across the entire code base. See the linked PRs in #3526 for a list of related changes.
  • We have (finally!) resolved a very old issue (#765) that made using HTTP/3 clients quite cumbersome: #3684.
  • The ConnectionState method on the Connection can now be called at any time. It doesn't block until completion of the TLS handshake any more: #3636.
  • QUIC v2 support was updated to the current IETF draft: #3631
  • It is now possible to accept connections right after receiving the ClientHello on the server side, i.e. 0.5 RTTs after the client started the handshake using ListenEarly. Using ListenEarly does not enable 0-RTT support any more, instead, 0-RTT is controlled via the Allow0RTT callback in the Config: #3635.

Changelog

New Contributors

Full Changelog: v0.31.1...v0.32.0

v0.31.1

08 Dec 20:20
d251219
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.31.0...v0.31.1

v0.31.0

16 Nov 23:12
8d496eb
Compare
Choose a tag to compare

Noteworthy Changes

QUIC:

  • We now expose a function, quic.ConnectionIDFromBytes, to convert a byte slice to a QUIC connection ID (#3614). Without this function, the quic.Config.ConnectionIDGenerator was not usable.
  • The QUIC version is not exposed on the quic.Connection.ConnectionState: #3620
  • The stateless reset key is now strongly typed, and needs to have a length of exactly 32 bytes: #3621
  • Parsing control messages (which happens for every UDP packet read from the socket) is now allocation-free: #3609

HTTP/3:

  • Add functions to write and parse HTTP/3 capsules: #3607

Changelog

New Contributors

Full Changelog: v0.30.0...v0.31.0

v0.30.0

22 Oct 11:35
af30cef
Compare
Choose a tag to compare

Highlights

This release speeds up quic-go by reducing allocations all over the library (see #3526).

In the http3 package, the Server now exposes a ServeQUICConn method, allowing users to serve HTTP on a single QUIC connection (#3587).

What's Changed

New Contributors

Full Changelog: v0.29.0...v0.30.0

v0.29.2

12 Oct 13:27
Compare
Choose a tag to compare

This patch release contains two patches (cherry-picked from these PRs):

  • include the standard library crypto/tls fix for standard library fix for golang/go#49126: #3583
  • prevent busy-looping by using a monotonous timer: #3570

v0.29.1

07 Oct 05:57
Compare
Choose a tag to compare

Full Changelog: v0.29.0...v0.29.1

v0.29.0

27 Aug 11:29
07412be
Compare
Choose a tag to compare

Breaking Changes

  • The API to control address validation during connection establishment using Retry packets (see Section 8.1 of RFC 9000) has been simplified: see #3494 for the design discussion
  • It's now possible to specify a custom Connection ID generator: #3452

Changelog

New Contributors

Full Changelog: v0.28.1...v0.29.0