A QUIC implementation in pure go

Marten Seemann 8185d1b4e0 Merge pull request #3424 from lucas-clemente/fix-tls-error-handling2 3 days ago
.circleci 366097106c use Go 1.18 on CI 2 months ago
.githooks 64f015fab4 only run Ginkgo focus detection in staged files in pre-commit hook 1 year ago
.github 7265441042 update golangci-lint to v1.45.2 1 month ago
benchmark 8752576f26 run gofumpt, enable the gofumpt linter 1 year ago
docs ef71186402 add gopher-logo 6 years ago
example 0ec8ee3cff do not embed http.Server in http3.Server (#3397) 3 days ago
fuzzing 60bbe92194 remove error return value from ComposeVersionNegotiation (#3410) 1 week ago
http3 de5f08171b introduce a http3.RoundTripOpt to prevent closing of request stream (#3411) 3 days ago
integrationtests 53be3ee500 don't send CONNECTION_CLOSE if error occurred before sending anything 3 days ago
internal c225299c84 handle TLS errors that occur before the ClientHello has been written 3 days ago
interop 0ec8ee3cff do not embed http.Server in http3.Server (#3397) 3 days ago
logging e71c236232 rename the Session to Connection 1 month ago
qlog 42ecbf0000 qlog the reason phrase of application and transport errors 1 year ago
quicvarint 4a9bd794bf quicvarint: export Min and Max (#3253) 9 months ago
.gitignore a7c3af2ccf add common temporary file patterns to .gitignore 1 year ago
.golangci.yml 7c63050da1 remove deprecated scopelint linter from golangci-lint 1 month ago
Changelog.md 286ae62720 Update Changelog 9 months ago
LICENSE bd3c7a96f9 add Google to license file 5 years ago
README.md d5961e9d60 update docs to reflect that we support RFC 9221 (Unreliable Datagrams) (#3382) 4 weeks ago
buffer_pool.go 82ac6dcf6d rename MaxReceivePacketSize to MaxPacketBufferSize 1 year ago
buffer_pool_test.go 82ac6dcf6d rename MaxReceivePacketSize to MaxPacketBufferSize 1 year ago
client.go d39a33f921 clone TLS conf in newClient (#3400) 1 week ago
client_test.go 4b17343631 rename the session to connection 1 month ago
closed_conn.go 97690dc493 rename the closed session to closed conn 1 month ago
closed_conn_test.go 97690dc493 rename the closed session to closed conn 1 month ago
codecov.yml 02b700804f remove support for quic-trace 1 year ago
config.go bfd685faf2 add a AllowConnectionWindowIncrease config option 4 months ago
config_test.go e71c236232 rename the Session to Connection 1 month ago
conn_id_generator.go b2857b5442 remove the RetireBugBackwardsCompatibilityMode 11 months ago
conn_id_generator_test.go 4b17343631 rename the session to connection 1 month ago
conn_id_manager.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
conn_id_manager_test.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
connection.go 53be3ee500 don't send CONNECTION_CLOSE if error occurred before sending anything 3 days ago
connection_test.go 53be3ee500 don't send CONNECTION_CLOSE if error occurred before sending anything 3 days ago
crypto_stream.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
crypto_stream_manager.go 55a07c34ee add the exhaustive linter 1 year ago
crypto_stream_manager_test.go 2adf923ee6 process the NewSessionTicket TLS message 3 years ago
crypto_stream_test.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
datagram_queue.go bcc7baf111 add an internal queue to signal that a datagram frame has been dequeued 1 year ago
datagram_queue_test.go 98145368cd implement receiving of DATAGRAM frames 1 year ago
errors.go 34322f2214 export the IdleTimeoutError and the HandshakeTimeoutError 1 year ago
frame_sorter.go 39fe927ef5 rewrite the frame sorter 2 years ago
frame_sorter_test.go 004d372ed6 fix seed generation in frame sorter tests 2 years ago
framer.go c741b6fc09 drop STREAM and *_BLOCKED frames from queue when 0-RTT is rejected 1 year ago
framer_test.go c741b6fc09 drop STREAM and *_BLOCKED frames from queue when 0-RTT is rejected 1 year ago
go.mod 2661c2807d update qtls packages (#3351) 2 months ago
go.sum 2661c2807d update qtls packages (#3351) 2 months ago
interface.go 0a08d62dea remove warning comments of stable implementation (#3399) 2 weeks ago
mock_ack_frame_source_test.go efe6d02bef use mockgen source mode 1 year ago
mock_batch_conn_test.go 3126062aa7 rename files dealing with low level conns to sys_conn 1 month ago
mock_conn_runner_test.go 4b17343631 rename the session to connection 1 month ago
mock_crypto_data_handler_test.go efe6d02bef use mockgen source mode 1 year ago
mock_crypto_stream_test.go efe6d02bef use mockgen source mode 1 year ago
mock_frame_source_test.go efe6d02bef use mockgen source mode 1 year ago
mock_mtu_discoverer_test.go 2e98150cd4 don't send path MTU probe packets on a timer (#3423) 3 days ago
mock_multiplexer_test.go efe6d02bef use mockgen source mode 1 year ago
mock_packer_test.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
mock_packet_handler_manager_test.go efe6d02bef use mockgen source mode 1 year ago
mock_packet_handler_test.go efe6d02bef use mockgen source mode 1 year ago
mock_packetconn_test.go 383f1a6e89 update gomock to v1.5.0 1 year ago
mock_quic_conn_test.go a088ba4607 rename quicConn.earlySessionReady to quicConn.earlyConnReady 1 month ago
mock_receive_stream_internal_test.go 90727cb41a introduce a quic.StreamError type and use it for stream cancelations 1 year ago
mock_sealing_manager_test.go efe6d02bef use mockgen source mode 1 year ago
mock_send_conn_test.go efe6d02bef use mockgen source mode 1 year ago
mock_send_stream_internal_test.go 90727cb41a introduce a quic.StreamError type and use it for stream cancelations 1 year ago
mock_sender_test.go efe6d02bef use mockgen source mode 1 year ago
mock_stream_getter_test.go 4b17343631 rename the session to connection 1 month ago
mock_stream_internal_test.go 90727cb41a introduce a quic.StreamError type and use it for stream cancelations 1 year ago
mock_stream_manager_test.go 4b17343631 rename the session to connection 1 month ago
mock_stream_sender_test.go efe6d02bef use mockgen source mode 1 year ago
mock_token_store_test.go 383f1a6e89 update gomock to v1.5.0 1 year ago
mock_unknown_packet_handler_test.go efe6d02bef use mockgen source mode 1 year ago
mock_unpacker_test.go 4b17343631 rename the session to connection 1 month ago
mockgen.go 86338d3ce0 rename the sessionRunner to connRunner 1 month ago
mockgen_private.sh 7d5a7b47cb remove unneeded calls to goimports when generating mocks 4 months ago
mtu_discoverer.go 2e98150cd4 don't send path MTU probe packets on a timer (#3423) 3 days ago
mtu_discoverer_test.go 2e98150cd4 don't send path MTU probe packets on a timer (#3423) 3 days ago
multiplexer.go 4b17343631 rename the session to connection 1 month ago
multiplexer_test.go a65274942c use a mock net.PacketConn in tests 1 year ago
packet_handler_map.go b9a77af8f9 don't set receive buffer if it is already large enough (#3407) 1 week ago
packet_handler_map_test.go 1ae835d1d8 rename occurrences of session in client, server and packetHandlerMap 1 month ago
packet_packer.go f5238bf7b1 move the ApplicationErrorCdoe to the qerr package 1 year ago
packet_packer_test.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
packet_unpacker.go dbb517858e fix incorrect usage of errors.Is 10 months ago
packet_unpacker_test.go dbb517858e fix incorrect usage of errors.Is 10 months ago
quic_suite_test.go b0974c14ad link to the wiki explaining the UDP receive buffer size 1 year ago
receive_stream.go ec118e440c protect against concurrent use of Stream.Read (#3380) 4 weeks ago
receive_stream_test.go ec118e440c protect against concurrent use of Stream.Read (#3380) 4 weeks ago
retransmission_queue.go 55a07c34ee add the exhaustive linter 1 year ago
retransmission_queue_test.go f4519cfd32 rename MaxDataFrame.ByteOffset to MaximumData 1 year ago
send_conn.go d7ad1b6b9b rename the connection to rawConn 1 month ago
send_conn_test.go eb6bdfdfc1 Use the correct source IP when binding multiple IPs 1 year ago
send_queue.go fd2c345152 sendQueue: ignore "datagram too large" error (#3328) 3 months ago
send_queue_test.go 37337597bd increase the size of the send queue 1 year ago
send_stream.go 8bcb6337d1 protect against concurrent use of Stream.Write (#3381) 4 weeks ago
send_stream_test.go 90727cb41a introduce a quic.StreamError type and use it for stream cancelations 1 year ago
server.go 60bbe92194 remove error return value from ComposeVersionNegotiation (#3410) 1 week ago
server_test.go 60bbe92194 remove error return value from ComposeVersionNegotiation (#3410) 1 week ago
stream.go 90727cb41a introduce a quic.StreamError type and use it for stream cancelations 1 year ago
stream_test.go 4f85f45f0a stop using net.Error.Temporary in tests 1 month ago
streams_map.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
streams_map_generic_helper.go 7cd4dea764 update the flow control windows of streams opened in 0-RTT 1 year ago
streams_map_incoming_bidi.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
streams_map_incoming_generic.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
streams_map_incoming_generic_test.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
streams_map_incoming_uni.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
streams_map_outgoing_bidi.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
streams_map_outgoing_generic.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
streams_map_outgoing_generic_test.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
streams_map_outgoing_uni.go 592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 1 year ago
streams_map_test.go 4f85f45f0a stop using net.Error.Temporary in tests 1 month ago
sys_conn.go d7ad1b6b9b rename the connection to rawConn 1 month ago
sys_conn_df.go 3126062aa7 rename files dealing with low level conns to sys_conn 1 month ago
sys_conn_df_linux.go 3126062aa7 rename files dealing with low level conns to sys_conn 1 month ago
sys_conn_df_windows.go 3126062aa7 rename files dealing with low level conns to sys_conn 1 month ago
sys_conn_helper_darwin.go 3126062aa7 rename files dealing with low level conns to sys_conn 1 month ago
sys_conn_helper_freebsd.go 3126062aa7 rename files dealing with low level conns to sys_conn 1 month ago
sys_conn_helper_linux.go 3126062aa7 rename files dealing with low level conns to sys_conn 1 month ago
sys_conn_no_oob.go d7ad1b6b9b rename the connection to rawConn 1 month ago
sys_conn_oob.go d7ad1b6b9b rename the connection to rawConn 1 month ago
sys_conn_oob_test.go 3126062aa7 rename files dealing with low level conns to sys_conn 1 month ago
sys_conn_test.go 3126062aa7 rename files dealing with low level conns to sys_conn 1 month ago
sys_conn_windows.go d7ad1b6b9b rename the connection to rawConn 1 month ago
sys_conn_windows_test.go 3126062aa7 rename files dealing with low level conns to sys_conn 1 month ago
token_store.go fe0f7aff3b define a quic.TokenStore interface and provide a LRU implementation 2 years ago
token_store_test.go fe0f7aff3b define a quic.TokenStore interface and provide a LRU implementation 2 years ago
tools.go 59ea0daea1 run gofmt to add the new go:build tags 8 months ago
window_update_queue.go 5466de6565 rename MaxStreamDataFrame.ByteOffset to MaximumStreamData 1 year ago
window_update_queue_test.go 5466de6565 rename MaxStreamDataFrame.ByteOffset to MaximumStreamData 1 year ago

README.md

A QUIC implementation in pure Go

PkgGoDev Code Coverage

quic-go is an implementation of the QUIC protocol, RFC 9000 protocol in Go, including the Unreliable Datagram Extension, RFC 9221.

In addition to RFC 9000, 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.16.x, Go 1.17.x, and Go 1.18.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

Project Description Stars
algernon Small self-contained pure-Go web server with Lua, Markdown, HTTP/2, QUIC, Redis and PostgreSQL support GitHub Repo stars
caddy Fast, multi-platform web server with automatic HTTPS GitHub Repo stars
go-ipfs IPFS implementation in go GitHub Repo stars
syncthing Open Source Continuous File Synchronization GitHub Repo stars
traefik The Cloud Native Application Proxy GitHub Repo stars
v2ray-core A platform for building proxies to bypass network restrictions GitHub Repo stars
cloudflared A tunneling daemon that proxies traffic from the Cloudflare network to your origins GitHub Repo stars
OONI Probe The Open Observatory of Network Interference (OONI) aims to empower decentralized efforts in documenting Internet censorship around the world. GitHub 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.