A QUIC implementation in pure go

Marten Seemann 3ff262dd7f Merge pull request #1489 from lucas-clemente/go-1.11 2 days ago
.circleci e23c08eef9 update CIs to Go 1.11 2 days ago
.travis a3821af65a don't run Chrome integration tests on Travis 2 months ago
benchmark 8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 1 month ago
docs ef71186402 add gopher-logo 2 years ago
example 7a566d9f28 Update certs 2 months ago
h2quic e23c08eef9 update CIs to Go 1.11 2 days ago
integrationtests e23c08eef9 update CIs to Go 1.11 2 days ago
internal 3ff262dd7f Merge pull request #1489 from lucas-clemente/go-1.11 2 days ago
qerr 948eef3e42 create a logger interface and use it everywhere 4 months ago
vendor e34256beed update mint 5 days 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 2 days ago
.travis.yml e23c08eef9 update CIs to Go 1.11 2 days ago
Changelog.md 5c8dec8331 release 0.9 2 days ago
LICENSE bd3c7a96f9 add Google to license file 1 year ago
README.md f1b49c2280 add a CircleCI badge to the README 2 months ago
appveyor.yml e23c08eef9 update CIs to Go 1.11 2 days ago
buffer_pool.go 07b8821ef7 use pointer to byte slices in the buffer pool 5 months ago
buffer_pool_test.go 07b8821ef7 use pointer to byte slices in the buffer pool 5 months ago
client.go 7bf5cb6e2a Merge pull request #1487 from lucas-clemente/version-negotiate-ietf-and-gquic 2 days ago
client_test.go 9608e8563f only accept 3 retries 3 days ago
codecov.yml 7346d12d6c use Genny to generate typed lists, based on Go standard library code 4 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 8 months ago
crypto_stream.go 04147d86da rename the cryptoStreamI interface to cryptoStream 1 week ago
crypto_stream_test.go 04147d86da rename the cryptoStreamI interface to cryptoStream 1 week ago
interface.go 6d3d6dc47d pass an error code to Session.CloseWithError 1 month ago
mint_utils.go f88b7bb175 implement the new Retry mechanism 5 days ago
mint_utils_test.go f88b7bb175 implement the new Retry mechanism 5 days ago
mock_crypto_stream_test.go d330fda94c also use the onHasStreamData callback for the crypto stream 7 months ago
mock_gquic_aead_test.go 302d2a1715 don't use trial decryption for IETF QUIC 4 months ago
mock_multiplexer_test.go c8d20e86d7 move listening from the multiplexer to the packet handler map 1 week ago
mock_packet_handler_manager_test.go ad5a3e2fa0 also use the multiplexer for the server 1 week ago
mock_packet_handler_test.go ad5a3e2fa0 also use the multiplexer for the server 1 week ago
mock_quic_aead_test.go 302d2a1715 don't use trial decryption for IETF QUIC 4 months ago
mock_quic_session_test.go f88b7bb175 implement the new Retry mechanism 5 days ago
mock_receive_stream_internal_test.go e802491a8f create internal interfaces for send and receive streams 7 months ago
mock_send_stream_internal_test.go e802491a8f create internal interfaces for send and receive streams 7 months ago
mock_session_runner_test.go b3fd768a61 use a smaller packetHandler interface 1 month ago
mock_stream_frame_source_test.go d330fda94c also use the onHasStreamData callback for the crypto stream 7 months ago
mock_stream_getter_test.go e802491a8f create internal interfaces for send and receive streams 7 months ago
mock_stream_internal_test.go 8a3f807a12 immediately delete a stream when it is completed 7 months ago
mock_stream_manager_test.go da49295b52 expose methods for opening and accepting unidirectional streams 5 months ago
mock_stream_sender_test.go 2e8a5807ba queue stream-level window updates from the flow controller directly 3 months ago
mock_unknown_packet_handler_test.go ad5a3e2fa0 also use the multiplexer for the server 1 week ago
mock_unpacker_test.go a298bd01c9 use a gomock packet unpacker 4 months ago
mockgen.go 76d4d43b50 move the mockgen cleanup commands to the mockgen script 1 week ago
mockgen_private.sh 76d4d43b50 move the mockgen cleanup commands to the mockgen script 1 week ago
multiplexer.go ad5a3e2fa0 also use the multiplexer for the server 1 week ago
multiplexer_test.go c8d20e86d7 move listening from the multiplexer to the packet handler map 1 week ago
packet_handler_map.go e23c08eef9 update CIs to Go 1.11 2 days ago
packet_handler_map_test.go ad5a3e2fa0 also use the multiplexer for the server 1 week ago
packet_number_generator.go 25a6dc9654 implement stateless handling of Initial packets for the TLS server 8 months ago
packet_number_generator_test.go 25a6dc9654 implement stateless handling of Initial packets for the TLS server 8 months ago
packet_packer.go f88b7bb175 implement the new Retry mechanism 5 days ago
packet_packer_test.go f88b7bb175 implement the new Retry mechanism 5 days ago
packet_unpacker.go 38efa84e9c use in place decryption for unpacking packets 4 months ago
packet_unpacker_test.go 302d2a1715 don't use trial decryption for IETF QUIC 4 months ago
quic_suite_test.go 759b0d87b1 refactor packet unpacking 8 months ago
receive_stream.go 83be64bb73 fix deadlock between onStreamCompleted and Session.Close 2 months ago
receive_stream_test.go 5f5bb1f700 allow empty STREAM frames at arbitrary offsets 3 months ago
send_stream.go 50397a979c only send BLOCKED frames if there is more data to send 2 weeks ago
send_stream_test.go 50397a979c only send BLOCKED frames if there is more data to send 2 weeks ago
server.go acb45c0ef1 always allow sending of IETF QUIC Version Negotiation Packets 2 days ago
server_session.go ad5a3e2fa0 also use the multiplexer for the server 1 week ago
server_session_test.go ad5a3e2fa0 also use the multiplexer for the server 1 week ago
server_test.go 6e22fbc77b fix flaky version negotiation tests 2 days ago
server_tls.go 9e83c96598 Merge pull request #1486 from lucas-clemente/send-ietf-quic-vnp 2 days ago
server_tls_test.go 9e83c96598 Merge pull request #1486 from lucas-clemente/send-ietf-quic-vnp 2 days ago
session.go 70992684af use server generated connection IDs when accepting a connection 5 days ago
session_test.go 04147d86da rename the cryptoStreamI interface to cryptoStream 1 week ago
stream.go 83be64bb73 fix deadlock between onStreamCompleted and Session.Close 2 months ago
stream_frame_sorter.go 5f5bb1f700 allow empty STREAM frames at arbitrary offsets 3 months ago
stream_frame_sorter_test.go 5f5bb1f700 allow empty STREAM frames at arbitrary offsets 3 months ago
stream_framer.go 04147d86da rename the cryptoStreamI interface to cryptoStream 1 week ago
stream_framer_test.go ca7291e8cf send retransmission as separate packets 5 months ago
stream_test.go 50397a979c only send BLOCKED frames if there is more data to send 2 weeks ago
streams_map.go b40942d39e send stream counts, not stream IDs, in the transport parameters 5 months ago
streams_map_generic_helper.go f8d28a96fe close all streams when closing the IETF QUIC streams map 4 months ago
streams_map_incoming_bidi.go f8d28a96fe close all streams when closing the IETF QUIC streams map 4 months ago
streams_map_incoming_generic.go f8d28a96fe close all streams when closing the IETF QUIC streams map 4 months ago
streams_map_incoming_generic_test.go f8d28a96fe close all streams when closing the IETF QUIC streams map 4 months ago
streams_map_incoming_uni.go f8d28a96fe close all streams when closing the IETF QUIC streams map 4 months ago
streams_map_legacy.go 245af2c596 make the number of incoming streams configurable, for gQUIC 5 months ago
streams_map_legacy_test.go 286a51bcc0 run staticcheck in gometalinter 5 months ago
streams_map_outgoing_bidi.go f8d28a96fe close all streams when closing the IETF QUIC streams map 4 months ago
streams_map_outgoing_generic.go f8d28a96fe close all streams when closing the IETF QUIC streams map 4 months ago
streams_map_outgoing_generic_test.go f8d28a96fe close all streams when closing the IETF QUIC streams map 4 months ago
streams_map_outgoing_uni.go f8d28a96fe close all streams when closing the IETF QUIC streams map 4 months ago
streams_map_test.go b40942d39e send stream counts, not stream IDs, in the transport parameters 5 months ago
window_update_queue.go 04147d86da rename the cryptoStreamI interface to cryptoStream 1 week ago
window_update_queue_test.go 08160ab18f queue connection-level window updates from the flow controller directly 3 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.

Roadmap

quic-go is compatible with the current version(s) of Google Chrome and QUIC as deployed on Google's servers. We're actively tracking the development of the Chrome code to ensure compatibility as the protocol evolves. In that process, we're dropping support for old QUIC versions. As Google's QUIC versions are expected to converge towards the IETF QUIC draft, quic-go will eventually implement that draft.

Guides

We currently support Go 1.9+.

Installing and updating dependencies:

go get -t -u ./...

Running tests:

go test ./...

Running the example server

go run example/main.go -www /var/www/

Using the quic_client from chromium:

quic_client --host=127.0.0.1 --port=6121 --v=1 https://quic.clemente.io

Using Chrome:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/chrome --no-proxy-server --enable-quic --origin-to-force-quic-on=quic.clemente.io:443 --host-resolver-rules='MAP quic.clemente.io:443 127.0.0.1:6121' https://quic.clemente.io

QUIC without HTTP/2

Take a look at this echo example.

Using the example client

go run example/client/main.go https://clemente.io

Usage

As a server

See the example server or try out Caddy (from version 0.9, instructions here). 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.