Categorygithub.com/Project-Faster/quic-go
modulepackage
0.0.0-20230209052722-fd67b0616c6d
Repository: https://github.com/project-faster/quic-go.git
Documentation: pkg.go.dev

# README

A QUIC implementation in pure Go

PkgGoDev Code Coverage

quic-go is an implementation of the QUIC protocol (RFC 9000, RFC 9001, RFC 9002) in Go, including the Unreliable Datagram Extension (RFC 9221) and Datagram Packetization Layer Path MTU Discovery (DPLPMTUD, RFC 8899). It has support for HTTP/3 (RFC 9114), including QPACK (RFC 9204).

In addition to the RFCs listed above, it currently implements the IETF QUIC draft-29. Support for draft-29 will eventually be dropped, as it is phased out of the ecosystem.

Guides

We currently support Go 1.18.x and Go 1.19.x and Go 1.20.x

Running tests:

go test ./...

QUIC without HTTP/3

Take a look at this echo example.

Usage

As a server

See the example server. Starting a QUIC server is very similar to the standard lib http in go:

http.Handle("/", http.FileServer(http.Dir(wwwDir)))
http3.ListenAndServeQUIC("localhost:4242", "/path/to/cert/chain.pem", "/path/to/privkey.pem", nil)

As a client

See the example client. Use a http3.RoundTripper as a Transport in a http.Client.

http.Client{
  Transport: &http3.RoundTripper{},
}

Projects using quic-go

ProjectDescriptionStars
AdGuardHomeFree and open source, powerful network-wide ads & trackers blocking DNS server.GitHub Repo stars
algernonSmall self-contained pure-Go web server with Lua, Markdown, HTTP/2, QUIC, Redis and PostgreSQL supportGitHub Repo stars
caddyFast, multi-platform web server with automatic HTTPSGitHub Repo stars
cloudflaredA tunneling daemon that proxies traffic from the Cloudflare network to your originsGitHub Repo stars
go-libp2plibp2p implementation in Go, powering Kubo (IPFS) and Lotus (Filecoin), among othersGitHub Repo stars
OONI ProbeNext generation OONI Probe. Library and CLI tool.GitHub Repo stars
syncthingOpen Source Continuous File SynchronizationGitHub Repo stars
traefikThe Cloud Native Application ProxyGitHub Repo stars
v2ray-coreA platform for building proxies to bypass network restrictionsGitHub Repo stars
YoMoStreaming Serverless Framework for Geo-distributed SystemGitHub Repo stars

Contributing

We are always happy to welcome new contributors! We have a number of self-contained issues that are suitable for first-time contributors, they are tagged with help wanted. If you have any questions, please feel free to reach out by opening an issue or leaving a comment.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package logging defines a logging interface for quic-go.
No description provided by the author
No description provided by the author

# Functions

ConnectionIDFromBytes interprets b as a Connection ID.
Dial establishes a new QUIC connection to a server using a net.PacketConn.
DialAddr establishes a new QUIC connection to a server.
DialAddrContext establishes a new QUIC connection to a server using the provided context.
DialAddrEarly establishes a new 0-RTT QUIC connection to a server.
DialAddrEarlyContext establishes a new 0-RTT QUIC connection to a server using provided context.
DialContext establishes a new QUIC connection to a server using a net.PacketConn using the provided context.
DialEarly establishes a new 0-RTT QUIC connection to a server using a net.PacketConn.
DialEarlyContext establishes a new 0-RTT QUIC connection to a server using a net.PacketConn using the provided context.
Listen listens for QUIC connections on a given net.PacketConn.
ListenAddr creates a QUIC server listening on a given address.
ListenAddrEarly works like ListenAddr, but it returns connections before the handshake completes.
ListenEarly works like Listen, but it returns connections before the handshake completes.
NewLRUTokenStore creates a new LRU cache for tokens received by the client.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Version1 is RFC 9000.
No description provided by the author
VersionDraft29 is IETF QUIC draft-29.

# Variables

ConnectionTracingKey can be used to associate a ConnectionTracer with a Connection.
Err0RTTRejected is the returned from: * Open{Uni}Stream{Sync} * Accept{Uni}Stream * Stream.Read and Stream.Write when the server rejects a 0-RTT connection attempt.
ErrServerClosed is returned by the Listener or EarlyListener's Accept method after a call to Close.

# Structs

A ClientToken is a token received by the client.
Config contains all configuration data needed for a QUIC server or client.
ConnectionState records basic details about a QUIC connection.
A StreamError is used for Stream.CancelRead and Stream.CancelWrite.

# Interfaces

A Connection is a QUIC connection between two peers.
A ConnectionIDGenerator is an interface that allows clients to implement their own format for the Connection IDs that servers/clients use as SrcConnectionID in QUIC packets.
An EarlyConnection is a connection that is handshaking.
An EarlyListener listens for incoming QUIC connections, and returns them before the handshake completes.
A Listener for incoming QUIC connections.
OOBCapablePacketConn is a connection that allows the reading of ECN bits from the IP header.
A ReceiveStream is a unidirectional Receive Stream.
A SendStream is a unidirectional Send Stream.
Stream is the interface implemented by QUIC streams In addition to the errors listed on the Connection, calls to stream functions can return a StreamError if the stream is canceled.
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
A ConnectionID is a QUIC Connection ID, as defined in RFC 9000.
No description provided by the author
No description provided by the author
No description provided by the author
StatelessResetKey is a key used to derive stateless reset tokens.
No description provided by the author
The StreamID is the ID of a QUIC stream.
No description provided by the author
No description provided by the author
No description provided by the author
A VersionNumber is a QUIC version number.