A QUIC implementation in pure go

Marten Seemann 424a66389c http3: fix double close of chan when using DontCloseRequestStream (#3561) 1 week ago
.circleci ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
.githooks 64f015fab4 only run Ginkgo focus detection in staged files in pre-commit hook 1 year ago
.github b372d02ac4 remove genny dependency 1 month ago
benchmark 8752576f26 run gofumpt, enable the gofumpt linter 1 year ago
docs ef71186402 add gopher-logo 6 years ago
example 498475fa60 update golangci-lint action to v3, golangci-lint to v1.48.0 (#3499) 1 month ago
fuzzing dfd35cb071 use a single bytes.Reader for frame parsing (#3536) 1 month ago
http3 424a66389c http3: fix double close of chan when using DontCloseRequestStream (#3561) 1 week ago
integrationtests ed15a94703 split the tracing function for received short and long header packets 1 month ago
internal 63764c429c use a sync.Pool for ACK frames 4 weeks ago
interop f2fa98c0dd implement a more intuitive address validation API 1 month ago
logging 656f3d2d7d remove the wire.ShortHeader in favor of more return values (#3535) 1 month ago
qlog 17761bf35f qlog: rename key_retired to key_discarded (#3463) 3 weeks ago
quicvarint 65dd82ad90 implement a quicvarint.Append method 1 month ago
.gitignore a7c3af2ccf add common temporary file patterns to .gitignore 1 year ago
.golangci.yml 7c63050da1 remove deprecated scopelint linter from golangci-lint 6 months ago
Changelog.md 286ae62720 Update Changelog 1 year ago
LICENSE bd3c7a96f9 add Google to license file 5 years ago
README.md ff47a7e14e add DPLPMTUD (RFC 8899) to list of supported RFCs in README (#3520) 1 month 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 66f6fe0b71 add support for providing a custom Connection ID generator via Config (#3452) 1 month ago
client_test.go 1aced95d41 use an array instead of a byte slice for Connection IDs 1 month ago
closed_conn.go b659414495 use a single Go routine to send copies of CONNECTION_CLOSE packets 1 month ago
closed_conn_test.go b659414495 use a single Go routine to send copies of CONNECTION_CLOSE packets 1 month ago
codecov.yml 48779d053f add a logging.NullTracer 1 month ago
config.go 66f6fe0b71 add support for providing a custom Connection ID generator via Config (#3452) 1 month ago
config_test.go 66f6fe0b71 add support for providing a custom Connection ID generator via Config (#3452) 1 month ago
conn_id_generator.go 4cbb4f8114 remove ConnectionID.Equal function 1 month ago
conn_id_generator_test.go 1aced95d41 use an array instead of a byte slice for Connection IDs 1 month ago
conn_id_manager.go 4cbb4f8114 remove ConnectionID.Equal function 1 month ago
conn_id_manager_test.go 4cbb4f8114 remove ConnectionID.Equal function 1 month ago
connection.go 2b54aeac2d Merge pull request #3545 from lucas-clemente/simplify-ack-only-packing 3 weeks ago
connection_test.go 818768df38 remove the MaybePackAckPacket from the packet packer 3 weeks ago
crypto_stream.go 43bde14cf7 implement generic Min and Max functions 1 month ago
crypto_stream_manager.go 55a07c34ee add the exhaustive linter 2 years 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 c57ea6f276 prioritize sending ACKs over sending new DATAGRAM frames (#3544) 3 weeks ago
datagram_queue_test.go c57ea6f276 prioritize sending ACKs over sending new DATAGRAM frames (#3544) 3 weeks ago
errors.go 34322f2214 export the IdleTimeoutError and the HandshakeTimeoutError 1 year ago
frame_sorter.go 7ebe1430ef use a generic linked list (#3487) 1 month ago
frame_sorter_test.go 7ebe1430ef use a generic linked list (#3487) 1 month ago
framer.go c741b6fc09 drop STREAM and *_BLOCKED frames from queue when 0-RTT is rejected 1 year ago
framer_test.go 1aced95d41 use an array instead of a byte slice for Connection IDs 1 month ago
go.mod 556a6e2f99 Merge pull request #3489 from lucas-clemente/generic-streams-map-incoming 1 month ago
go.sum 556a6e2f99 Merge pull request #3489 from lucas-clemente/generic-streams-map-incoming 1 month ago
interface.go 1aced95d41 use an array instead of a byte slice for Connection IDs 1 month 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 6 months ago
mock_conn_runner_test.go b659414495 use a single Go routine to send copies of CONNECTION_CLOSE packets 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) 4 months ago
mock_multiplexer_test.go efe6d02bef use mockgen source mode 1 year ago
mock_packer_test.go 818768df38 remove the MaybePackAckPacket from the packet packer 3 weeks ago
mock_packet_handler_manager_test.go b659414495 use a single Go routine to send copies of CONNECTION_CLOSE packets 1 month 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 6 months 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 6 months 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 6 months 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 656f3d2d7d remove the wire.ShortHeader in favor of more return values (#3535) 1 month ago
mockgen.go 86338d3ce0 rename the sessionRunner to connRunner 6 months ago
mockgen_private.sh 7d5a7b47cb remove unneeded calls to goimports when generating mocks 8 months ago
mtu_discoverer.go 2e98150cd4 don't send path MTU probe packets on a timer (#3423) 4 months ago
mtu_discoverer_test.go 43bde14cf7 implement generic Min and Max functions 1 month ago
multiplexer.go 4b17343631 rename the session to connection 6 months ago
multiplexer_test.go a65274942c use a mock net.PacketConn in tests 2 years ago
packet_handler_map.go 1aced95d41 use an array instead of a byte slice for Connection IDs 1 month ago
packet_handler_map_test.go 1aced95d41 use an array instead of a byte slice for Connection IDs 1 month ago
packet_packer.go 818768df38 remove the MaybePackAckPacket from the packet packer 3 weeks ago
packet_packer_test.go 818768df38 remove the MaybePackAckPacket from the packet packer 3 weeks ago
packet_unpacker.go 656f3d2d7d remove the wire.ShortHeader in favor of more return values (#3535) 1 month ago
packet_unpacker_test.go 656f3d2d7d remove the wire.ShortHeader in favor of more return values (#3535) 1 month ago
quic_suite_test.go 498475fa60 update golangci-lint action to v3, golangci-lint to v1.48.0 (#3499) 1 month ago
receive_stream.go ec118e440c protect against concurrent use of Stream.Read (#3380) 5 months ago
receive_stream_test.go ec118e440c protect against concurrent use of Stream.Read (#3380) 5 months ago
retransmission_queue.go 55a07c34ee add the exhaustive linter 2 years ago
retransmission_queue_test.go f4519cfd32 rename MaxDataFrame.ByteOffset to MaximumData 2 years ago
send_conn.go d7ad1b6b9b rename the connection to rawConn 6 months 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) 7 months ago
send_queue_test.go 37337597bd increase the size of the send queue 1 year ago
send_stream.go 43bde14cf7 implement generic Min and Max functions 1 month ago
send_stream_test.go 90727cb41a introduce a quic.StreamError type and use it for stream cancelations 1 year ago
server.go 4f3d3b36ac introduce a separate code path for unpacking short header packets 1 month ago
server_test.go dfd35cb071 use a single bytes.Reader for frame parsing (#3536) 1 month 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 6 months ago
streams_map.go 621e9d4642 use a generic streams map for incoming streams 1 month ago
streams_map_incoming.go 621e9d4642 use a generic streams map for incoming streams 1 month ago
streams_map_incoming_test.go dfd35cb071 use a single bytes.Reader for frame parsing (#3536) 1 month ago
streams_map_outgoing.go bebff462c8 use a generic streams map for outgoing streams (#3488) 1 month ago
streams_map_outgoing_test.go bebff462c8 use a generic streams map for outgoing streams (#3488) 1 month ago
streams_map_test.go 4f85f45f0a stop using net.Error.Temporary in tests 6 months ago
sys_conn.go 706a482340 only set DF for sockets that can handle it (#3448) 3 months ago
sys_conn_df.go ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
sys_conn_df_linux.go ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
sys_conn_df_windows.go ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
sys_conn_helper_darwin.go ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
sys_conn_helper_freebsd.go ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
sys_conn_helper_linux.go ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
sys_conn_no_oob.go ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
sys_conn_oob.go 5cd5341545 preallocate the message buffers of the ipv4.Message passed to ReadBatch (#3541) 1 month ago
sys_conn_oob_test.go ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
sys_conn_test.go 3126062aa7 rename files dealing with low level conns to sys_conn 6 months ago
sys_conn_windows.go ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
sys_conn_windows_test.go ea9de26ed5 drop support for Go 1.16 and 1.17 (#3482) 1 month ago
token_store.go fe0f7aff3b define a quic.TokenStore interface and provide a LRU implementation 3 years ago
token_store_test.go fe0f7aff3b define a quic.TokenStore interface and provide a LRU implementation 3 years ago
tools.go b372d02ac4 remove genny dependency 1 month ago
window_update_queue.go 5466de6565 rename MaxStreamDataFrame.ByteOffset to MaximumStreamData 2 years ago
window_update_queue_test.go 5466de6565 rename MaxStreamDataFrame.ByteOffset to MaximumStreamData 2 years ago
zero_rtt_queue.go feb94286a5 move the 0-RTT queue to a separate file 1 month ago

README.md

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.

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
YoMo Streaming Serverless Framework for Geo-distributed System 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.