A QUIC implementation in pure go

Marten Seemann f5d88d3edd Merge pull request #2359 from lucas-clemente/simplify-ack-range-pruning 16 hours ago
.circleci a2e61ad76d add a client and server implementation for the interop test runner 4 months ago
.travis 669138ee60 update Fuzzit binary 5 months ago
benchmark a93e544c94 remove Session.Close() 3 weeks ago
docs ef71186402 add gopher-logo 3 years ago
example d6e4b100e8 fix keylog creation in the example client 1 week ago
fuzzing 7b10453af8 implement the Retry integrity tag 1 month ago
http3 6de97fce55 Add LocalAddrContextKey/ServerContextKey to http3 request context 2 weeks ago
integrationtests f91dfda8c3 make the TLS cipher suites configurable 2 weeks ago
internal a5fc72047e simplify pruning of old ACK ranges 16 hours ago
interop 5aaab80698 export qlog files if the QLOGDIR env is set in interop client and server 1 week ago
qlog 14a5cc8ab4 add support for the connection_started event 4 days ago
quictrace 6b22f36d82 add the stylecheck linter 5 months ago
.editorconfig 2e1da961c5 add editorconfig 3 years ago
.gitignore b1a3e7a00b add a -qlog flag to the example client and server 1 week ago
.golangci.yml 1f8a47af02 implement a ClientSessionCache that can save application data 1 month ago
.travis.yml 1350f499b5 update GolangCI-Lint to v1.18.0 5 months ago
Changelog.md f91dfda8c3 make the TLS cipher suites configurable 2 weeks ago
LICENSE bd3c7a96f9 add Google to license file 3 years ago
README.md 56e6f1adca remove outdated install instructions in README 3 weeks ago
appveyor.yml 22b36a783b increase the TIMESCALE factor on AppVeyor 1 month ago
buffer_pool.go d642bf9098 simplify content storage in packed packets 1 day ago
buffer_pool_test.go d642bf9098 simplify content storage in packed packets 1 day ago
client.go 14a5cc8ab4 add support for the connection_started event 4 days ago
client_test.go b031615db5 export a qlog when the session's run loop stops 1 week ago
closed_session.go a93e544c94 remove Session.Close() 3 weeks ago
closed_session_test.go a93e544c94 remove Session.Close() 3 weeks ago
codecov.yml 031c1709e6 implement a basic store for new connection IDs 3 months ago
config.go 72c2f9464c add a Clone() function to the Config 1 week ago
config_test.go b031615db5 export a qlog when the session's run loop stops 1 week ago
conn.go 34b688b3b9 add a LocalAddr to the Session 2 years ago
conn_id_generator.go 634169b061 don't return a stateless reset token when adding a new connection ID 2 weeks ago
conn_id_generator_test.go 634169b061 don't return a stateless reset token when adding a new connection ID 2 weeks ago
conn_id_manager.go f35a32989c enforce the active_connection_id_limit 2 months ago
conn_id_manager_test.go f35a32989c enforce the active_connection_id_limit 2 months ago
conn_test.go 81be522bf3 identify connections by their local addr when adding to the multiplexer 5 months ago
crypto_stream.go 8cde4ab638 refactor how session tickets are sent 1 week ago
crypto_stream_manager.go 2adf923ee6 process the NewSessionTicket TLS message 10 months ago
crypto_stream_manager_test.go 2adf923ee6 process the NewSessionTicket TLS message 10 months ago
crypto_stream_test.go 8cde4ab638 refactor how session tickets are sent 1 week ago
frame_sorter.go 6b22f36d82 add the stylecheck linter 5 months ago
frame_sorter_test.go 6b22f36d82 add the stylecheck linter 5 months ago
framer.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 5 months ago
framer_test.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 5 months ago
go.mod 572ef44cf2 use GoJay to marshal JSON 1 week ago
go.sum 572ef44cf2 use GoJay to marshal JSON 1 week ago
interface.go b031615db5 export a qlog when the session's run loop stops 1 week ago
mock_ack_frame_source_test.go 5e34cb1d71 run go generate ./... 11 months ago
mock_connection_test.go 15301a7f6e use a mock connection in the session tests 1 month ago
mock_crypto_data_handler_test.go 5e34cb1d71 run go generate ./... 11 months ago
mock_crypto_stream_test.go 5e34cb1d71 run go generate ./... 11 months ago
mock_frame_source_test.go e622207822 assemble ackhandler.Frames, not wire.Frames, when packing a packet 5 months ago
mock_multiplexer_test.go 94046cdb4b implement sending of stateless resets 11 months ago
mock_packer_test.go 29b784e782 rename packet packing functions in the packet packer 1 day ago
mock_packet_handler_manager_test.go 93693349f3 collapse packetHandlerManager.Add and AddIfNotTaken into one function 2 weeks ago
mock_packet_handler_test.go a93e544c94 remove Session.Close() 3 weeks ago
mock_quic_session_test.go 539097fc6e return a quic.ConnectionState from Session.ConnectionState() 3 weeks ago
mock_receive_stream_internal_test.go 5e34cb1d71 run go generate ./... 11 months ago
mock_sealing_manager_test.go fc37cdc5c5 implement unpacking of 0-RTT packets 1 month ago
mock_send_stream_internal_test.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 5 months ago
mock_session_runner_test.go 93693349f3 collapse packetHandlerManager.Add and AddIfNotTaken into one function 2 weeks ago
mock_stream_getter_test.go 5e34cb1d71 run go generate ./... 11 months ago
mock_stream_internal_test.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 5 months ago
mock_stream_manager_test.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 8 months ago
mock_stream_sender_test.go 5e34cb1d71 run go generate ./... 11 months ago
mock_token_store_test.go 9c97a5e95f add the TokenStore to the quic.Config, store received tokens 6 months ago
mock_unknown_packet_handler_test.go dc75123836 fix race condition when closing the server after a Read failed 9 months ago
mock_unpacker_test.go bb48c9b31a pass the time a packet was received to the short header opener 6 months ago
mockgen.go c809166cab update gomock, simplify script for generation mocks of private types 3 weeks ago
mockgen_private.sh c809166cab update gomock, simplify script for generation mocks of private types 3 weeks ago
multiplexer.go 8388b8ea3a add network to multiplexer index 4 months ago
multiplexer_test.go 81be522bf3 identify connections by their local addr when adding to the multiplexer 5 months ago
packet_handler_map.go d642bf9098 simplify content storage in packed packets 1 day ago
packet_handler_map_test.go 93693349f3 collapse packetHandlerManager.Add and AddIfNotTaken into one function 2 weeks ago
packet_packer.go 7a532326ec don't pack ACK frames in the second part of a coalesced packet 1 day ago
packet_packer_test.go 7a532326ec don't pack ACK frames in the second part of a coalesced packet 1 day ago
packet_unpacker.go fc37cdc5c5 implement unpacking of 0-RTT packets 1 month ago
packet_unpacker_test.go fc37cdc5c5 implement unpacking of 0-RTT packets 1 month ago
quic_suite_test.go c7334e3e66 replace closed sessions in the packet handler map 3 months ago
receive_stream.go 529e14d0cc simplify onStreamCompleted in the receiveStream 3 months ago
receive_stream_test.go dc66c8a4e4 fix handling of RESET_STREAM frames after receiving the final offset 3 months ago
retransmission_queue.go f49451ce3c queue lost STREAM frames in the stream's retransmission queue 5 months ago
retransmission_queue_test.go f49451ce3c queue lost STREAM frames in the stream's retransmission queue 5 months ago
send_queue.go d642bf9098 simplify content storage in packed packets 1 day ago
send_queue_test.go d642bf9098 simplify content storage in packed packets 1 day ago
send_stream.go d93afcac53 cancel the stream context as early as possible 3 months ago
send_stream_test.go 6b22f36d82 add the stylecheck linter 5 months ago
server.go 73937e8753 Merge pull request #2349 from lucas-clemente/coalesced-packets 1 day ago
server_test.go 643f0b4c67 drop incoming packets when the server's receive queue is full 6 days ago
session.go a5fc72047e simplify pruning of old ACK ranges 16 hours ago
session_test.go a5fc72047e simplify pruning of old ACK ranges 16 hours ago
stream.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 5 months ago
stream_test.go 3266e36811 drop support for gQUIC 1 year ago
streams_map.go 2c2b5da612 Merge pull request #2209 from lucas-clemente/stream-count-errors 3 months ago
streams_map_generic_helper.go b69e2a805f remove nolint commands that show up in GoDoc 3 months ago
streams_map_incoming_bidi.go b69e2a805f remove nolint commands that show up in GoDoc 3 months ago
streams_map_incoming_generic.go b69e2a805f remove nolint commands that show up in GoDoc 3 months ago
streams_map_incoming_generic_test.go 4b58bc0d07 make the stream deletion error message more specific 3 months ago
streams_map_incoming_uni.go b69e2a805f remove nolint commands that show up in GoDoc 3 months ago
streams_map_outgoing_bidi.go b69e2a805f remove nolint commands that show up in GoDoc 3 months ago
streams_map_outgoing_generic.go b69e2a805f remove nolint commands that show up in GoDoc 3 months ago
streams_map_outgoing_generic_test.go 4b58bc0d07 make the stream deletion error message more specific 3 months ago
streams_map_outgoing_uni.go b69e2a805f remove nolint commands that show up in GoDoc 3 months ago
streams_map_test.go 2c2b5da612 Merge pull request #2209 from lucas-clemente/stream-count-errors 3 months ago
token_store.go fe0f7aff3b define a quic.TokenStore interface and provide a LRU implementation 6 months ago
token_store_test.go fe0f7aff3b define a quic.TokenStore interface and provide a LRU implementation 6 months ago
window_update_queue.go ddc886be7a remove inactive streams from the window update queue 3 weeks ago
window_update_queue_test.go ddc886be7a remove inactive streams from the window update queue 3 weeks ago
zero_rtt_queue.go 9b71878d53 release packet buffers when deleting a 0-RTT queue 6 days ago
zero_rtt_queue_test.go 9b71878d53 release packet buffers when deleting a 0-RTT queue 6 days ago

README.md

A QUIC implementation in pure Go

Godoc Reference Travis Build Status CircleCI Build Status Windows Build Status Code Coverage fuzzit

quic-go is an implementation of the QUIC protocol in Go. It roughly implements the IETF QUIC draft, although we don't fully support any of the draft versions at the moment.

Version compatibility

Since quic-go is under active development, there's no guarantee that two builds of different commits are interoperable. The QUIC version used in the master branch is just a placeholder, and should not be considered stable.

If you want to use quic-go as a library in other projects, please consider using a tagged release. These releases expose experimental QUIC versions, which are guaranteed to be stable.

Guides

We currently support Go 1.13+, with Go modules support enabled.

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{},
}

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.