A QUIC implementation in pure go

Marten Seemann b9ab1d172d Merge pull request #2440 from lucas-clemente/integrationtests-qlog 6 days ago
.circleci c88a69034d use Go 1.14's embedded interfaces, update CIs 1 month ago
.travis aa9a5a4e5f add a lint script to verify that Ginkgo is not imported 1 month ago
benchmark a93e544c94 remove Session.Close() 2 months ago
docs ef71186402 add gopher-logo 3 years ago
example 3e8c3cafc1 make the buffered qlog writer used in interop flush before closing 1 week ago
fuzzing 7b10453af8 implement the Retry integrity tag 2 months ago
http3 43dfc7281f update H3 and hq to -27 1 month ago
integrationtests b9ab1d172d Merge pull request #2440 from lucas-clemente/integrationtests-qlog 6 days ago
internal ef901e3435 use the current timestamp of every event in qlog 1 week ago
interop 3e8c3cafc1 make the buffered qlog writer used in interop flush before closing 1 week ago
qlog a82d6bb910 qlog stateless resets 6 days ago
quictrace 6b22f36d82 add the stylecheck linter 6 months ago
.editorconfig 2e1da961c5 add editorconfig 4 years ago
.gitignore b1a3e7a00b add a -qlog flag to the example client and server 1 month ago
.golangci.yml 1f8a47af02 implement a ClientSessionCache that can save application data 3 months ago
.travis.yml 0b3340493a update GolangCI-Lint to v1.23.8 3 weeks ago
Changelog.md 653bcff188 update the Changelog 1 month ago
LICENSE bd3c7a96f9 add Google to license file 3 years ago
README.md c88a69034d use Go 1.14's embedded interfaces, update CIs 1 month ago
appveyor.yml c88a69034d use Go 1.14's embedded interfaces, update CIs 1 month ago
buffer_pool.go d642bf9098 simplify content storage in packed packets 1 month ago
buffer_pool_test.go d642bf9098 simplify content storage in packed packets 1 month ago
client.go ef901e3435 use the current timestamp of every event in qlog 1 week ago
client_test.go b031615db5 export a qlog when the session's run loop stops 1 month ago
closed_session.go a93e544c94 remove Session.Close() 2 months ago
closed_session_test.go a93e544c94 remove Session.Close() 2 months ago
codecov.yml 031c1709e6 implement a basic store for new connection IDs 4 months ago
config.go 4109df32ff copy the GetLogWriter callback when populating a quic.Config 1 month ago
config_test.go 4109df32ff copy the GetLogWriter callback when populating a quic.Config 1 month ago
conn.go 34b688b3b9 add a LocalAddr to the Session 3 years ago
conn_id_generator.go 6d61dccc2f rename the constructors for the various qerr.Error flavors 1 week ago
conn_id_generator_test.go 634169b061 don't return a stateless reset token when adding a new connection ID 1 month ago
conn_id_manager.go eab5adc48c use the connection ID from the preferred_address transport parameter 3 weeks ago
conn_id_manager_test.go eab5adc48c use the connection ID from the preferred_address transport parameter 3 weeks ago
conn_test.go 81be522bf3 identify connections by their local addr when adding to the multiplexer 7 months ago
crypto_stream.go 6d61dccc2f rename the constructors for the various qerr.Error flavors 1 week ago
crypto_stream_manager.go 2adf923ee6 process the NewSessionTicket TLS message 1 year ago
crypto_stream_manager_test.go 2adf923ee6 process the NewSessionTicket TLS message 1 year ago
crypto_stream_test.go 8cde4ab638 refactor how session tickets are sent 1 month ago
frame_sorter.go 6b22f36d82 add the stylecheck linter 6 months ago
frame_sorter_test.go 6b22f36d82 add the stylecheck linter 6 months ago
framer.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 7 months ago
framer_test.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 7 months ago
go.mod 6fe4878f0e update to qtls based on Go 1.14's TLS implementation 1 month ago
go.sum 6fe4878f0e update to qtls based on Go 1.14's TLS implementation 1 month ago
interface.go 76bdd4a397 continuously encode qlog events 2 weeks ago
mock_ack_frame_source_test.go 5e34cb1d71 run go generate ./... 1 year ago
mock_connection_test.go 15301a7f6e use a mock connection in the session tests 2 months ago
mock_crypto_data_handler_test.go 5e34cb1d71 run go generate ./... 1 year ago
mock_crypto_stream_test.go 5e34cb1d71 run go generate ./... 1 year ago
mock_frame_source_test.go e622207822 assemble ackhandler.Frames, not wire.Frames, when packing a packet 7 months ago
mock_multiplexer_test.go 94046cdb4b implement sending of stateless resets 1 year ago
mock_packer_test.go 0ef4f06189 move the transport parameters from the handshake to the wire package 2 weeks ago
mock_packet_handler_manager_test.go 93693349f3 collapse packetHandlerManager.Add and AddIfNotTaken into one function 1 month ago
mock_packet_handler_test.go a93e544c94 remove Session.Close() 2 months ago
mock_quic_session_test.go 539097fc6e return a quic.ConnectionState from Session.ConnectionState() 2 months ago
mock_receive_stream_internal_test.go 5e34cb1d71 run go generate ./... 1 year ago
mock_sealing_manager_test.go fc37cdc5c5 implement unpacking of 0-RTT packets 3 months ago
mock_send_stream_internal_test.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 7 months ago
mock_session_runner_test.go 93693349f3 collapse packetHandlerManager.Add and AddIfNotTaken into one function 1 month ago
mock_stream_getter_test.go 5e34cb1d71 run go generate ./... 1 year ago
mock_stream_internal_test.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 7 months ago
mock_stream_manager_test.go 0ef4f06189 move the transport parameters from the handshake to the wire package 2 weeks ago
mock_stream_sender_test.go 5e34cb1d71 run go generate ./... 1 year ago
mock_token_store_test.go 9c97a5e95f add the TokenStore to the quic.Config, store received tokens 7 months ago
mock_unknown_packet_handler_test.go dc75123836 fix race condition when closing the server after a Read failed 10 months ago
mock_unpacker_test.go bb48c9b31a pass the time a packet was received to the short header opener 7 months ago
mockgen.go c809166cab update gomock, simplify script for generation mocks of private types 2 months ago
mockgen_private.sh c809166cab update gomock, simplify script for generation mocks of private types 2 months ago
multiplexer.go 8388b8ea3a add network to multiplexer index 6 months ago
multiplexer_test.go 81be522bf3 identify connections by their local addr when adding to the multiplexer 7 months ago
packet_handler_map.go a82d6bb910 qlog stateless resets 6 days ago
packet_handler_map_test.go a82d6bb910 qlog stateless resets 6 days ago
packet_packer.go 9dec939784 Merge pull request #2432 from lucas-clemente/max-udp-payload-size 1 week ago
packet_packer_test.go 9dec939784 Merge pull request #2432 from lucas-clemente/max-udp-payload-size 1 week ago
packet_unpacker.go e57caf0bae send an INVALID_TOKEN error when receiving an invalid token 1 month ago
packet_unpacker_test.go fc37cdc5c5 implement unpacking of 0-RTT packets 3 months ago
quic_suite_test.go c7334e3e66 replace closed sessions in the packet handler map 5 months ago
receive_stream.go 529e14d0cc simplify onStreamCompleted in the receiveStream 4 months ago
receive_stream_test.go dc66c8a4e4 fix handling of RESET_STREAM frames after receiving the final offset 4 months ago
retransmission_queue.go 5bfac02a44 split CRYPTO frames when packing retransmissions, if neccessary 1 month ago
retransmission_queue_test.go 5bfac02a44 split CRYPTO frames when packing retransmissions, if neccessary 1 month ago
send_queue.go d642bf9098 simplify content storage in packed packets 1 month ago
send_queue_test.go d642bf9098 simplify content storage in packed packets 1 month ago
send_stream.go 599d937966 make Stream.Close() a no-op after the stream was closed for shutdown 1 week ago
send_stream_test.go 599d937966 make Stream.Close() a no-op after the stream was closed for shutdown 1 week ago
server.go b749357ece pass the same connection ID to GetLogWriter for client and server 1 week ago
server_test.go 0ef4f06189 move the transport parameters from the handshake to the wire package 2 weeks ago
session.go a82d6bb910 qlog stateless resets 6 days ago
session_test.go 9dec939784 Merge pull request #2432 from lucas-clemente/max-udp-payload-size 1 week ago
stream.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 7 months ago
stream_test.go 3266e36811 drop support for gQUIC 1 year ago
streams_map.go 6d61dccc2f rename the constructors for the various qerr.Error flavors 1 week ago
streams_map_generic_helper.go b69e2a805f remove nolint commands that show up in GoDoc 4 months ago
streams_map_incoming_bidi.go b69e2a805f remove nolint commands that show up in GoDoc 4 months ago
streams_map_incoming_generic.go b69e2a805f remove nolint commands that show up in GoDoc 4 months ago
streams_map_incoming_generic_test.go 4b58bc0d07 make the stream deletion error message more specific 4 months ago
streams_map_incoming_uni.go b69e2a805f remove nolint commands that show up in GoDoc 4 months ago
streams_map_outgoing_bidi.go b69e2a805f remove nolint commands that show up in GoDoc 4 months ago
streams_map_outgoing_generic.go b69e2a805f remove nolint commands that show up in GoDoc 4 months ago
streams_map_outgoing_generic_test.go 4b58bc0d07 make the stream deletion error message more specific 4 months ago
streams_map_outgoing_uni.go b69e2a805f remove nolint commands that show up in GoDoc 4 months ago
streams_map_test.go 0ef4f06189 move the transport parameters from the handshake to the wire package 2 weeks ago
token_store.go fe0f7aff3b define a quic.TokenStore interface and provide a LRU implementation 7 months ago
token_store_test.go fe0f7aff3b define a quic.TokenStore interface and provide a LRU implementation 7 months ago
window_update_queue.go ddc886be7a remove inactive streams from the window update queue 2 months ago
window_update_queue_test.go ddc886be7a remove inactive streams from the window update queue 2 months ago
zero_rtt_queue.go 9b71878d53 release packet buffers when deleting a 0-RTT queue 1 month ago
zero_rtt_queue_test.go 9b71878d53 release packet buffers when deleting a 0-RTT queue 1 month 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.14+, 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.