A QUIC implementation in pure go

Marten Seemann 9e6bff0b98 Merge pull request #2138 from lucas-clemente/linting 17 hours ago
.circleci 761b6d50f7 update CIs to Go 1.13 1 week ago
.travis 669138ee60 update Fuzzit binary 5 days ago
benchmark 305d6e0fbe make the benchmark suite compatible with Go 1.13 1 week ago
docs ef71186402 add gopher-logo 3 years ago
example 84c6a60771 make example server conform with the GET /xxx format used for interop 1 month ago
fuzzing 5ea33cd31e implement a buffer pool for STREAM frames 1 week ago
http3 b6330461d6 rework stream / connection erros for the client 3 days ago
integrationtests 6b22f36d82 add the stylecheck linter 18 hours ago
internal 6b22f36d82 add the stylecheck linter 18 hours ago
quictrace 6b22f36d82 add the stylecheck linter 18 hours ago
.editorconfig 2e1da961c5 add editorconfig 3 years ago
.gitignore 1ff6c04bdd add .gitignore entries for fuzzing 3 weeks ago
.golangci.yml 6b22f36d82 add the stylecheck linter 18 hours ago
.travis.yml 1350f499b5 update GolangCI-Lint to v1.18.0 18 hours ago
Changelog.md b60d6ba42d add a Changelog entry for the TokenStore 1 month ago
LICENSE bd3c7a96f9 add Google to license file 2 years ago
README.md 9d37e2a79f use updated qtls based on Go's 1.13 crypto/tls 1 week ago
appveyor.yml 761b6d50f7 update CIs to Go 1.13 1 week ago
buffer_pool.go 33bf79c735 fix packet buffer usage when handling coalesced packets 6 months ago
buffer_pool_test.go 33bf79c735 fix packet buffer usage when handling coalesced packets 6 months ago
client.go 6b22f36d82 add the stylecheck linter 18 hours ago
client_test.go 9c97a5e95f add the TokenStore to the quic.Config, store received tokens 1 month ago
closed_session.go ab2b26a5cb add the unparam linter 18 hours ago
closed_session_test.go 22b12f199e replace locally closed sessions with a dedicated closed session 2 weeks ago
codecov.yml 2c22eb644c fuzz the header parsing 1 month ago
conn.go 34b688b3b9 add a LocalAddr to the Session 2 years ago
conn_test.go 81be522bf3 identify connections by their local addr when adding to the multiplexer 2 weeks ago
crypto_stream.go ba1bcf6e0c use the STREAM frame buffer for receiving data 1 week ago
crypto_stream_manager.go 2adf923ee6 process the NewSessionTicket TLS message 5 months ago
crypto_stream_manager_test.go 2adf923ee6 process the NewSessionTicket TLS message 5 months ago
crypto_stream_test.go e622207822 assemble ackhandler.Frames, not wire.Frames, when packing a packet 2 weeks ago
frame_sorter.go 6b22f36d82 add the stylecheck linter 18 hours ago
frame_sorter_test.go 6b22f36d82 add the stylecheck linter 18 hours ago
framer.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 2 weeks ago
framer_test.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 2 weeks ago
go.mod fa89ec345a add support for ChaCha20 header protection 1 week ago
go.sum fa89ec345a add support for ChaCha20 header protection 1 week ago
interface.go 9c97a5e95f add the TokenStore to the quic.Config, store received tokens 1 month ago
mock_ack_frame_source_test.go 5e34cb1d71 run go generate ./... 6 months ago
mock_crypto_data_handler_test.go 5e34cb1d71 run go generate ./... 6 months ago
mock_crypto_stream_test.go 5e34cb1d71 run go generate ./... 6 months ago
mock_frame_source_test.go e622207822 assemble ackhandler.Frames, not wire.Frames, when packing a packet 2 weeks ago
mock_multiplexer_test.go 94046cdb4b implement sending of stateless resets 6 months ago
mock_packer_test.go 1d392b4276 retransmit frames instead of packets 2 weeks ago
mock_packet_handler_manager_test.go 22b12f199e replace locally closed sessions with a dedicated closed session 2 weeks ago
mock_packet_handler_test.go 5e34cb1d71 run go generate ./... 6 months ago
mock_quic_session_test.go 5cbb8d6597 implement a listener that returns early sessions 1 month ago
mock_receive_stream_internal_test.go 5e34cb1d71 run go generate ./... 6 months ago
mock_sealing_manager_test.go b2d3ef691e use separate sealer interfaces for long and short header packets 2 months ago
mock_send_stream_internal_test.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 2 weeks ago
mock_session_runner_test.go 22b12f199e replace locally closed sessions with a dedicated closed session 2 weeks ago
mock_stream_getter_test.go 5e34cb1d71 run go generate ./... 6 months ago
mock_stream_internal_test.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 2 weeks ago
mock_stream_manager_test.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 2 months ago
mock_stream_sender_test.go 5e34cb1d71 run go generate ./... 6 months ago
mock_token_store_test.go 9c97a5e95f add the TokenStore to the quic.Config, store received tokens 1 month ago
mock_unknown_packet_handler_test.go dc75123836 fix race condition when closing the server after a Read failed 4 months ago
mock_unpacker_test.go bb48c9b31a pass the time a packet was received to the short header opener 1 month ago
mockgen.go 9c97a5e95f add the TokenStore to the quic.Config, store received tokens 1 month ago
mockgen_private.sh 76d4d43b50 move the mockgen cleanup commands to the mockgen script 1 year ago
multiplexer.go 81be522bf3 identify connections by their local addr when adding to the multiplexer 2 weeks ago
multiplexer_test.go 81be522bf3 identify connections by their local addr when adding to the multiplexer 2 weeks ago
packet_handler_map.go ab2b26a5cb add the unparam linter 18 hours ago
packet_handler_map_test.go 96db15c836 accept smaller stateless resets 2 weeks ago
packet_packer.go ab2b26a5cb add the unparam linter 18 hours ago
packet_packer_test.go 5ea33cd31e implement a buffer pool for STREAM frames 1 week ago
packet_unpacker.go 6b22f36d82 add the stylecheck linter 18 hours ago
packet_unpacker_test.go bb48c9b31a pass the time a packet was received to the short header opener 1 month ago
quic_suite_test.go 81be522bf3 identify connections by their local addr when adding to the multiplexer 2 weeks ago
receive_stream.go 6b22f36d82 add the stylecheck linter 18 hours ago
receive_stream_test.go 6b22f36d82 add the stylecheck linter 18 hours ago
retransmission_queue.go f49451ce3c queue lost STREAM frames in the stream's retransmission queue 2 weeks ago
retransmission_queue_test.go f49451ce3c queue lost STREAM frames in the stream's retransmission queue 2 weeks ago
send_queue.go 00c19f7241 implement a send queue to send packet asynchronously 3 weeks ago
send_queue_test.go 00c19f7241 implement a send queue to send packet asynchronously 3 weeks ago
send_stream.go 6b22f36d82 add the stylecheck linter 18 hours ago
send_stream_test.go 6b22f36d82 add the stylecheck linter 18 hours ago
server.go 22b12f199e replace locally closed sessions with a dedicated closed session 2 weeks ago
server_test.go 5cbb8d6597 implement a listener that returns early sessions 1 month ago
session.go ab2b26a5cb add the unparam linter 18 hours ago
session_test.go ab2b26a5cb add the unparam linter 18 hours ago
stream.go 0edb3f2b93 return ackhandler.Frames from sendStream.popStreamFrame 2 weeks ago
stream_test.go 3266e36811 drop support for gQUIC 10 months ago
streams_map.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 2 months ago
streams_map_generic_helper.go ab2b26a5cb add the unparam linter 18 hours ago
streams_map_incoming_bidi.go 5550ba2c3b add a context to Session.Accept{Uni}Stream 2 months ago
streams_map_incoming_generic.go ab2b26a5cb add the unparam linter 18 hours ago
streams_map_incoming_generic_test.go 5550ba2c3b add a context to Session.Accept{Uni}Stream 2 months ago
streams_map_incoming_uni.go 5550ba2c3b add a context to Session.Accept{Uni}Stream 2 months ago
streams_map_outgoing_bidi.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 2 months ago
streams_map_outgoing_generic.go ab2b26a5cb add the unparam linter 18 hours ago
streams_map_outgoing_generic_test.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 2 months ago
streams_map_outgoing_uni.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 2 months ago
streams_map_test.go 5550ba2c3b add a context to Session.Accept{Uni}Stream 2 months ago
token_store.go fe0f7aff3b define a quic.TokenStore interface and provide a LRU implementation 1 month ago
token_store_test.go fe0f7aff3b define a quic.TokenStore interface and provide a LRU implementation 1 month ago
window_update_queue.go 8bd6168511 never increase the flow control limit for the crypto stream 1 year ago
window_update_queue_test.go 8bd6168511 never increase the flow control limit for the crypto stream 1 year 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.

Google QUIC

quic-go used to support both the QUIC versions supported by Google Chrome and QUIC as deployed on Google's servers, as well as IETF QUIC. Due to the divergence of the two protocols, we decided to not support both versions any more.

The master branch only supports IETF QUIC. For Google QUIC support, please refer to the gquic branch.

Guides

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

Installing and updating dependencies:

go get -u ./...

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.