A QUIC implementation in pure go

Marten Seemann 879467b3c5 Merge pull request #1997 from lucas-clemente/new-header-format 1 day ago
.circleci c00eb1f5b5 add Go mod support 4 months ago
.travis b52d45a1e5 use GolangCI-Lint instead of gometalinter 4 months ago
benchmark 5550ba2c3b add a context to Session.Accept{Uni}Stream 3 weeks ago
docs ef71186402 add gopher-logo 3 years ago
example 58ef419869 fix the /dynamic endpoint on the example server 4 days ago
http3 2b8cece60a add a context to Session.Open{Uni}StreamSync 3 weeks ago
integrationtests c8b7037d60 Merge pull request #1982 from lucas-clemente/mitm-test 1 week ago
internal 879467b3c5 Merge pull request #1997 from lucas-clemente/new-header-format 1 day ago
quictrace c6b8ed9322 update quic-trace to handle CRYPTO frames 3 weeks ago
.editorconfig 2e1da961c5 add editorconfig 3 years ago
.gitignore 73f83ca4bb add a tracing option to the example server 3 weeks ago
.golangci.yml 4f6d0e651a implement HTTP/3 3 months ago
.travis.yml c00eb1f5b5 add Go mod support 4 months ago
Changelog.md a09c045324 initiate a key update after sending / receiving 100000 packets 2 weeks ago
LICENSE bd3c7a96f9 add Google to license file 2 years ago
README.md a06bc25055 mention Go mod as a requirement in the README 2 weeks ago
appveyor.yml c00eb1f5b5 add Go mod support 4 months ago
buffer_pool.go 33bf79c735 fix packet buffer usage when handling coalesced packets 4 months ago
buffer_pool_test.go 33bf79c735 fix packet buffer usage when handling coalesced packets 4 months ago
client.go 755a46d6e2 allow host without port passed as 'host' argument in Dial function. 1 week ago
client_test.go 755a46d6e2 allow host without port passed as 'host' argument in Dial function. 1 week ago
codecov.yml 8926531f7e add the quic-trace protobuf 3 weeks ago
conn.go 34b688b3b9 add a LocalAddr to the Session 2 years ago
conn_test.go 5e01c49fdf send Version Negotiation packets in a separate Go routine 7 months ago
crypto_stream.go e7ed5e3c92 implement the crypto stream for post-handshake crypto messages 5 months ago
crypto_stream_manager.go 2adf923ee6 process the NewSessionTicket TLS message 3 months ago
crypto_stream_manager_test.go 2adf923ee6 process the NewSessionTicket TLS message 3 months ago
crypto_stream_test.go e7ed5e3c92 implement the crypto stream for post-handshake crypto messages 5 months ago
frame_sorter.go 1864e301ef move tracking of the final stream offset to the stream 5 months ago
frame_sorter_test.go 1864e301ef move tracking of the final stream offset to the stream 5 months ago
framer.go dba964f735 fix packing of maximum-size packets 2 months ago
framer_test.go dba964f735 fix packing of maximum-size packets 2 months ago
go.mod c52a28cec1 explicitly trigger sending of session tickets 1 week ago
go.sum c52a28cec1 explicitly trigger sending of session tickets 1 week ago
interface.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 3 weeks ago
mock_ack_frame_source_test.go 5e34cb1d71 run go generate ./... 4 months ago
mock_crypto_data_handler_test.go 5e34cb1d71 run go generate ./... 4 months ago
mock_crypto_stream_test.go 5e34cb1d71 run go generate ./... 4 months ago
mock_frame_source_test.go 109bb3fe62 pass the length of the packet being packet around in the packet packer 2 months ago
mock_multiplexer_test.go 94046cdb4b implement sending of stateless resets 4 months ago
mock_packer_test.go 5e34cb1d71 run go generate ./... 4 months ago
mock_packet_handler_manager_test.go 94046cdb4b implement sending of stateless resets 4 months ago
mock_packet_handler_test.go 5e34cb1d71 run go generate ./... 4 months ago
mock_quic_session_test.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 3 weeks ago
mock_receive_stream_internal_test.go 5e34cb1d71 run go generate ./... 4 months ago
mock_sealing_manager_test.go b2d3ef691e use separate sealer interfaces for long and short header packets 3 weeks ago
mock_send_stream_internal_test.go 5e34cb1d71 run go generate ./... 4 months ago
mock_session_runner_test.go 94046cdb4b implement sending of stateless resets 4 months ago
mock_stream_getter_test.go 5e34cb1d71 run go generate ./... 4 months ago
mock_stream_internal_test.go 5e34cb1d71 run go generate ./... 4 months ago
mock_stream_manager_test.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 3 weeks ago
mock_stream_sender_test.go 5e34cb1d71 run go generate ./... 4 months ago
mock_unknown_packet_handler_test.go dc75123836 fix race condition when closing the server after a Read failed 2 months ago
mock_unpacker_test.go 5e34cb1d71 run go generate ./... 4 months ago
mockgen.go 67f923c736 return the Opener from the crypto setup 7 months ago
mockgen_private.sh 76d4d43b50 move the mockgen cleanup commands to the mockgen script 11 months ago
multiplexer.go 94046cdb4b implement sending of stateless resets 4 months ago
multiplexer_test.go 94046cdb4b implement sending of stateless resets 4 months ago
packet_handler_map.go dc75123836 fix race condition when closing the server after a Read failed 2 months ago
packet_handler_map_test.go b3fe0fdbf9 only send stateless resets if a stateless reset key is configured 4 months ago
packet_packer.go 0ce749b5f1 pack ACK-only packets for all encryption levels 2 weeks ago
packet_packer_test.go 0ce749b5f1 pack ACK-only packets for all encryption levels 2 weeks ago
packet_unpacker.go 7b9b711a77 fix timing side channel when reading headers with invalid reserved bits 2 weeks ago
packet_unpacker_test.go 7b9b711a77 fix timing side channel when reading headers with invalid reserved bits 2 weeks ago
quic_suite_test.go 3266e36811 drop support for gQUIC 8 months ago
receive_stream.go 2787a6051a remove some defer statements in the stream 5 months ago
receive_stream_test.go ca939df44e remove the error return value from Stream.CancelRead 5 months ago
send_stream.go 9b5a20e772 remove some unused functions 4 months ago
send_stream_test.go 3372fa794c remove the error return value from Stream.CancelWrite 5 months ago
server.go 8da857fdb4 fix logging of Retries 2 weeks ago
server_test.go 12bce1caaa add a context to Listener.Accept 3 weeks ago
session.go 6af7df436a don't close the session when unpacking a packet fails 2 weeks ago
session_test.go 6af7df436a don't close the session when unpacking a packet fails 2 weeks ago
stream.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 8 months ago
stream_test.go 3266e36811 drop support for gQUIC 8 months ago
streams_map.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 3 weeks ago
streams_map_generic_helper.go 9518c90c0a implement and use the MAX_STREAMS frame 8 months ago
streams_map_incoming_bidi.go 5550ba2c3b add a context to Session.Accept{Uni}Stream 3 weeks ago
streams_map_incoming_generic.go 5550ba2c3b add a context to Session.Accept{Uni}Stream 3 weeks ago
streams_map_incoming_generic_test.go 5550ba2c3b add a context to Session.Accept{Uni}Stream 3 weeks ago
streams_map_incoming_uni.go 5550ba2c3b add a context to Session.Accept{Uni}Stream 3 weeks ago
streams_map_outgoing_bidi.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 3 weeks ago
streams_map_outgoing_generic.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 3 weeks ago
streams_map_outgoing_generic_test.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 3 weeks ago
streams_map_outgoing_uni.go 2b8cece60a add a context to Session.Open{Uni}StreamSync 3 weeks ago
streams_map_test.go 5550ba2c3b add a context to Session.Accept{Uni}Stream 3 weeks ago
window_update_queue.go 8bd6168511 never increase the flow control limit for the crypto stream 10 months ago
window_update_queue_test.go 8bd6168511 never increase the flow control limit for the crypto stream 10 months ago

README.md

A QUIC implementation in pure Go

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

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.12+, 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.