A QUIC implementation in pure go

Marten Seemann 7fa0ebbfc8 Merge pull request #1780 from lucas-clemente/standard-library-tls 12 hours ago
.circleci 4ed0ef4b9c use Go 1.12rc1 on CIs 15 hours ago
.travis 3f3fe2b4d9 fix Travis configuration to actually run the integration tests 3 months ago
benchmark 8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 7 months ago
docs ef71186402 add gopher-logo 2 years ago
example f6357dc858 use the self-signed certificate for the example server and client 2 months ago
h2quic f3414e732a simplify closing the http.ResponseBody using that CancelRead is a no-op 4 weeks ago
integrationtests 9bffce264f don't run the version negotiation tests with race detector 2 weeks ago
internal 500717066e use (a modified version of) the standard library TLS implementation 13 hours ago
vendor 500717066e use (a modified version of) the standard library TLS implementation 13 hours ago
.editorconfig 2e1da961c5 add editorconfig 2 years ago
.gitignore c3da72d498 add debug.test (dvelve output) to gitignore 2 years ago
.gometalinter.json 6117d8c722 run gometalinter with staticcheck instead of megacheck 1 month ago
.travis.yml 4ed0ef4b9c use Go 1.12rc1 on CIs 15 hours ago
Changelog.md bbe8c64cb7 release 0.10 5 months ago
LICENSE bd3c7a96f9 add Google to license file 2 years ago
README.md 2aa5e61cc9 update README with the new Go version requirement 13 hours ago
appveyor.yml 4ed0ef4b9c use Go 1.12rc1 on CIs 15 hours ago
buffer_pool.go b32fb438af make putting back packet buffers a member function of packetBuffer 1 month ago
buffer_pool_test.go b32fb438af make putting back packet buffers a member function of packetBuffer 1 month ago
client.go 17f4ebad64 handle Retry packets in the session 2 weeks ago
client_test.go 17f4ebad64 handle Retry packets in the session 2 weeks ago
codecov.yml 7346d12d6c use Genny to generate typed lists, based on Go standard library code 10 months ago
conn.go 34b688b3b9 add a LocalAddr to the Session 1 year ago
conn_test.go 5e01c49fdf send Version Negotiation packets in a separate Go routine 2 months ago
crypto_stream.go e7ed5e3c92 implement the crypto stream for post-handshake crypto messages 2 weeks ago
crypto_stream_manager.go 2fffad94bc ignore post-handshake CRYPTO frames 3 weeks ago
crypto_stream_manager_test.go 2fffad94bc ignore post-handshake CRYPTO frames 3 weeks ago
crypto_stream_test.go e7ed5e3c92 implement the crypto stream for post-handshake crypto messages 2 weeks ago
frame_sorter.go 1864e301ef move tracking of the final stream offset to the stream 1 month ago
frame_sorter_test.go 1864e301ef move tracking of the final stream offset to the stream 1 month ago
framer.go 82508f1562 use tls-tris instead of mint 3 months ago
framer_test.go 387613aa20 rename the BLOCKED from to DATA_BLOCKED 3 months ago
interface.go 3372fa794c remove the error return value from Stream.CancelWrite 4 weeks ago
mock_ack_frame_source_test.go a303ad9745 always send ACKs in the correct packet number space 1 month ago
mock_crypto_data_handler_test.go e0bc72451b fix the file name of the mock crypto data handler 3 months ago
mock_crypto_stream_test.go 387c28d707 when the encryption level changes, reject data on that crypto stream 3 months ago
mock_frame_source_test.go 25847cfc30 handle the crypto stream separately in the packet packer 4 months ago
mock_multiplexer_test.go 1a0aa50471 delete unused connections from the multiplexer 1 month ago
mock_packer_test.go 7a7e7ca6eb add a function to pass the retry token to the packet packer 2 weeks ago
mock_packet_handler_manager_test.go bb185a3ad2 add a function to close the packet handler map 4 weeks ago
mock_packet_handler_test.go c5ca6fd7e5 parse the extended header in the session 2 months ago
mock_quic_session_test.go 178ac0dacb keep increasing the packet number after version negotiation and retry 2 months ago
mock_receive_stream_internal_test.go ca939df44e remove the error return value from Stream.CancelRead 4 weeks ago
mock_sealing_manager_test.go 3266e36811 drop support for gQUIC 3 months ago
mock_send_stream_internal_test.go 3372fa794c remove the error return value from Stream.CancelWrite 4 weeks ago
mock_session_runner_test.go 65cca7b726 immediately remove sessions that were closed remotely 3 months ago
mock_stream_getter_test.go e802491a8f create internal interfaces for send and receive streams 1 year ago
mock_stream_internal_test.go 3372fa794c remove the error return value from Stream.CancelWrite 4 weeks ago
mock_stream_manager_test.go 9518c90c0a implement and use the MAX_STREAMS frame 3 months ago
mock_stream_sender_test.go 2e8a5807ba queue stream-level window updates from the flow controller directly 9 months ago
mock_unknown_packet_handler_test.go ad5a3e2fa0 also use the multiplexer for the server 6 months ago
mock_unpacker_test.go aaea375fb6 move parsing of the extended header to the unpacker 2 months ago
mockgen.go 67f923c736 return the Opener from the crypto setup 2 months ago
mockgen_private.sh 76d4d43b50 move the mockgen cleanup commands to the mockgen script 6 months ago
multiplexer.go 1a0aa50471 delete unused connections from the multiplexer 1 month ago
multiplexer_test.go c8d20e86d7 move listening from the multiplexer to the packet handler map 6 months ago
packet_handler_map.go bb185a3ad2 add a function to close the packet handler map 4 weeks ago
packet_handler_map_test.go 10ee1521be fix race conditions in packet handler map unit tests 4 weeks ago
packet_packer.go f6642ff948 use separate packet number spaces for sending packets 1 week ago
packet_packer_test.go f6642ff948 use separate packet number spaces for sending packets 1 week ago
packet_unpacker.go 855b643c7c move frame parsing to the session 1 month ago
packet_unpacker_test.go 855b643c7c move frame parsing to the session 1 month ago
quic_suite_test.go 3266e36811 drop support for gQUIC 3 months ago
receive_stream.go 2787a6051a remove some defer statements in the stream 4 weeks ago
receive_stream_test.go ca939df44e remove the error return value from Stream.CancelRead 4 weeks ago
send_stream.go 2787a6051a remove some defer statements in the stream 4 weeks ago
send_stream_test.go 3372fa794c remove the error return value from Stream.CancelWrite 4 weeks ago
server.go 155ebd18a2 parse and send the ack_delay_exponent in the transport parameters 3 weeks ago
server_session.go c5ca6fd7e5 parse the extended header in the session 2 months ago
server_session_test.go c5ca6fd7e5 parse the extended header in the session 2 months ago
server_test.go 181aa493e0 make sure not to return closed session from Listener.Accept() 1 month ago
session.go f6642ff948 use separate packet number spaces for sending packets 1 week ago
session_test.go 17f4ebad64 handle Retry packets in the session 2 weeks ago
stream.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 3 months ago
stream_test.go 3266e36811 drop support for gQUIC 3 months ago
streams_map.go a2e48e204b return a net.Error when opening streams 1 month ago
streams_map_generic_helper.go 9518c90c0a implement and use the MAX_STREAMS frame 3 months ago
streams_map_incoming_bidi.go f17ddffb70 don't delete a stream until it has been accepted 1 month ago
streams_map_incoming_generic.go f17ddffb70 don't delete a stream until it has been accepted 1 month ago
streams_map_incoming_generic_test.go f17ddffb70 don't delete a stream until it has been accepted 1 month ago
streams_map_incoming_uni.go f17ddffb70 don't delete a stream until it has been accepted 1 month ago
streams_map_outgoing_bidi.go a2e48e204b return a net.Error when opening streams 1 month ago
streams_map_outgoing_generic.go a2e48e204b return a net.Error when opening streams 1 month ago
streams_map_outgoing_generic_test.go a2e48e204b return a net.Error when opening streams 1 month ago
streams_map_outgoing_uni.go a2e48e204b return a net.Error when opening streams 1 month ago
streams_map_test.go f17ddffb70 don't delete a stream until it has been accepted 1 month ago
window_update_queue.go 8bd6168511 never increase the flow control limit for the crypto stream 5 months ago
window_update_queue_test.go 8bd6168511 never increase the flow control limit for the crypto stream 5 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+.

Installing and updating dependencies:

go get -t -u ./...

Running tests:

go test ./...

HTTP mapping

We're currently not implementing the HTTP mapping as described in the QUIC over HTTP draft. The HTTP mapping here is a leftover from Google QUIC.

QUIC without HTTP/2

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)))
h2quic.ListenAndServeQUIC("localhost:4242", "/path/to/cert/chain.pem", "/path/to/privkey.pem", nil)

As a client

See the example client. Use a h2quic.RoundTripper as a Transport in a http.Client.

http.Client{
  Transport: &h2quic.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.