A QUIC implementation in pure go

Marten Seemann 54c287c7e6 Merge pull request #1614 from lucas-clemente/rename-params-file 11 hours ago
.circleci 3266e36811 drop support for gQUIC 2 weeks ago
.travis 3f3fe2b4d9 fix Travis configuration to actually run the integration tests 2 weeks ago
benchmark 8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 4 months ago
docs ef71186402 add gopher-logo 2 years ago
example 3266e36811 drop support for gQUIC 2 weeks ago
h2quic 3ffea5d8c4 internalize the qerr package 1 week ago
integrationtests 7696bf59ea remove 6 byte packet numbers 15 hours ago
internal 54c287c7e6 Merge pull request #1614 from lucas-clemente/rename-params-file 11 hours ago
vendor 3266e36811 drop support for gQUIC 2 weeks ago
.editorconfig 2e1da961c5 add editorconfig 2 years ago
.gitignore c3da72d498 add debug.test (dvelve output) to gitignore 2 years ago
.gometalinter.json e23c08eef9 update CIs to Go 1.11 3 months ago
.travis.yml 0f36f94b41 update Go to 1.10.4 and 1.11 on the CIs 2 months ago
Changelog.md bbe8c64cb7 release 0.10 2 months ago
LICENSE bd3c7a96f9 add Google to license file 1 year ago
README.md 3266e36811 drop support for gQUIC 2 weeks ago
appveyor.yml 09ae414811 remove stray AppVeyor command 2 months ago
buffer_pool.go 07b8821ef7 use pointer to byte slices in the buffer pool 8 months ago
buffer_pool_test.go 07b8821ef7 use pointer to byte slices in the buffer pool 8 months ago
client.go 65cca7b726 immediately remove sessions that were closed remotely 3 days ago
client_test.go a3831b2134 rename removing of connection IDs to retiring 3 days ago
codecov.yml 7346d12d6c use Genny to generate typed lists, based on Go standard library code 7 months ago
conn.go 34b688b3b9 add a LocalAddr to the Session 1 year ago
conn_test.go 25a6dc9654 implement stateless handling of Initial packets for the TLS server 11 months ago
crypto_stream.go 387c28d707 when the encryption level changes, reject data on that crypto stream 3 weeks ago
crypto_stream_manager.go b63c81f0bf try decrypting undecryptable packets when the encryption level changes 3 weeks ago
crypto_stream_manager_test.go b63c81f0bf try decrypting undecryptable packets when the encryption level changes 3 weeks ago
crypto_stream_test.go 387c28d707 when the encryption level changes, reject data on that crypto stream 3 weeks ago
frame_sorter.go 387c28d707 when the encryption level changes, reject data on that crypto stream 3 weeks ago
frame_sorter_test.go 387c28d707 when the encryption level changes, reject data on that crypto stream 3 weeks ago
framer.go 82508f1562 use tls-tris instead of mint 3 weeks ago
framer_test.go 387613aa20 rename the BLOCKED from to DATA_BLOCKED 1 week ago
interface.go 73ca6a06eb encode the original connection ID into the cookie 1 week ago
mock_ack_frame_source_test.go 3266e36811 drop support for gQUIC 2 weeks ago
mock_crypto_data_handler_test.go e0bc72451b fix the file name of the mock crypto data handler 2 days ago
mock_crypto_stream_test.go 387c28d707 when the encryption level changes, reject data on that crypto stream 3 weeks ago
mock_frame_source_test.go 25847cfc30 handle the crypto stream separately in the packet packer 1 month ago
mock_multiplexer_test.go c8d20e86d7 move listening from the multiplexer to the packet handler map 3 months ago
mock_packer_test.go 06db39836b move queueing of control frames to the framer 1 month ago
mock_packet_handler_manager_test.go 65cca7b726 immediately remove sessions that were closed remotely 3 days ago
mock_packet_handler_test.go ad5a3e2fa0 also use the multiplexer for the server 3 months ago
mock_quic_aead_test.go 82508f1562 use tls-tris instead of mint 3 weeks ago
mock_quic_session_test.go f88b7bb175 implement the new Retry mechanism 3 months ago
mock_receive_stream_internal_test.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 2 weeks ago
mock_sealing_manager_test.go 3266e36811 drop support for gQUIC 2 weeks ago
mock_send_stream_internal_test.go 25847cfc30 handle the crypto stream separately in the packet packer 1 month ago
mock_session_runner_test.go 65cca7b726 immediately remove sessions that were closed remotely 3 days ago
mock_stream_getter_test.go e802491a8f create internal interfaces for send and receive streams 10 months ago
mock_stream_internal_test.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 2 weeks ago
mock_stream_manager_test.go 9518c90c0a implement and use the MAX_STREAMS frame 1 week ago
mock_stream_sender_test.go 2e8a5807ba queue stream-level window updates from the flow controller directly 6 months ago
mock_unknown_packet_handler_test.go ad5a3e2fa0 also use the multiplexer for the server 3 months ago
mock_unpacker_test.go a298bd01c9 use a gomock packet unpacker 7 months ago
mockgen.go e0bc72451b fix the file name of the mock crypto data handler 2 days ago
mockgen_private.sh 76d4d43b50 move the mockgen cleanup commands to the mockgen script 3 months ago
multiplexer.go ad5a3e2fa0 also use the multiplexer for the server 3 months ago
multiplexer_test.go c8d20e86d7 move listening from the multiplexer to the packet handler map 3 months ago
packet_handler_map.go f0a7b6e6c3 remove late packet handling in packet handler map 2 days ago
packet_handler_map_test.go 26911583ae fix a flaky packet handler map unit test on AppVeyor 2 days ago
packet_packer.go c81cd92daf return the packet number length when peek a new packet number 2 weeks ago
packet_packer_test.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 2 weeks ago
packet_unpacker.go 3ffea5d8c4 internalize the qerr package 1 week ago
packet_unpacker_test.go c37b698f68 Merge pull request #1596 from lucas-clemente/internalize-errors 1 week ago
quic_suite_test.go 3266e36811 drop support for gQUIC 2 weeks ago
receive_stream.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 2 weeks ago
receive_stream_test.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 2 weeks ago
send_stream.go 05ecf9bc02 rename the STREAM_BLOCKED frame to STREAM_DATA_BLOCKED 1 week ago
send_stream_test.go 05ecf9bc02 rename the STREAM_BLOCKED frame to STREAM_DATA_BLOCKED 1 week ago
server.go 65cca7b726 immediately remove sessions that were closed remotely 3 days ago
server_session.go 3266e36811 drop support for gQUIC 2 weeks ago
server_session_test.go 3266e36811 drop support for gQUIC 2 weeks ago
server_test.go 73ca6a06eb encode the original connection ID into the cookie 1 week ago
session.go 6c7fbc4a79 remove special case for testing when receiving packets in the session 16 hours ago
session_test.go 590df11604 Merge pull request #1613 from lucas-clemente/remove-pnlen-6 11 hours ago
stream.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 2 weeks ago
stream_test.go 3266e36811 drop support for gQUIC 2 weeks ago
streams_map.go 9518c90c0a implement and use the MAX_STREAMS frame 1 week ago
streams_map_generic_helper.go 9518c90c0a implement and use the MAX_STREAMS frame 1 week ago
streams_map_incoming_bidi.go 9518c90c0a implement and use the MAX_STREAMS frame 1 week ago
streams_map_incoming_generic.go 9518c90c0a implement and use the MAX_STREAMS frame 1 week ago
streams_map_incoming_generic_test.go 9518c90c0a implement and use the MAX_STREAMS frame 1 week ago
streams_map_incoming_uni.go 9518c90c0a implement and use the MAX_STREAMS frame 1 week ago
streams_map_outgoing_bidi.go c37b698f68 Merge pull request #1596 from lucas-clemente/internalize-errors 1 week ago
streams_map_outgoing_generic.go c37b698f68 Merge pull request #1596 from lucas-clemente/internalize-errors 1 week ago
streams_map_outgoing_generic_test.go c37b698f68 Merge pull request #1596 from lucas-clemente/internalize-errors 1 week ago
streams_map_outgoing_uni.go c37b698f68 Merge pull request #1596 from lucas-clemente/internalize-errors 1 week ago
streams_map_test.go c37b698f68 Merge pull request #1596 from lucas-clemente/internalize-errors 1 week ago
window_update_queue.go 8bd6168511 never increase the flow control limit for the crypto stream 2 months ago
window_update_queue_test.go 8bd6168511 never increase the flow control limit for the crypto stream 2 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.9+.

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.