A QUIC implementation in pure go

Marten Seemann 93c7eb94ce Merge pull request #1533 from lucas-clemente/split-packet-packers 2 days ago
.circleci 0f36f94b41 update Go to 1.10.4 and 1.11 on the CIs 1 month ago
.travis a3821af65a don't run Chrome integration tests on Travis 4 months ago
benchmark 8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 3 months ago
docs ef71186402 add gopher-logo 2 years ago
example 69d3929ae0 add a quiet flag to the example client 2 weeks ago
h2quic 9252e12da5 fix incorrect type assertion in h2quic server 1 month ago
integrationtests c9fe7456e8 activate gQUIC 44 in the Chrome integration tests 1 month ago
internal fbc3041e4d add logging for skipped packet numbers 3 days ago
qerr 948eef3e42 create a logger interface and use it everywhere 6 months ago
vendor e34256beed update mint 2 months 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 months ago
.travis.yml 0f36f94b41 update Go to 1.10.4 and 1.11 on the CIs 1 month ago
Changelog.md bbe8c64cb7 release 0.10 1 month ago
LICENSE bd3c7a96f9 add Google to license file 1 year ago
README.md f1b49c2280 add a CircleCI badge to the README 4 months ago
appveyor.yml 09ae414811 remove stray AppVeyor command 1 month ago
buffer_pool.go 07b8821ef7 use pointer to byte slices in the buffer pool 7 months ago
buffer_pool_test.go 07b8821ef7 use pointer to byte slices in the buffer pool 7 months ago
client.go c1f55ba910 use tls.Config.ServerName for the passing the hostname around 2 weeks ago
client_test.go c1f55ba910 use tls.Config.ServerName for the passing the hostname around 2 weeks ago
codecov.yml 7346d12d6c use Genny to generate typed lists, based on Go standard library code 6 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 10 months ago
crypto_stream.go 25847cfc30 handle the crypto stream separately in the packet packer 2 weeks ago
crypto_stream_test.go dbada7ad02 store stream data, not STREAM frames, in the streamFrameSorter 1 month ago
frame_sorter.go 74662e8dae rename the streamFrameSorter to frameSorter 1 month ago
frame_sorter_test.go 74662e8dae rename the streamFrameSorter to frameSorter 1 month ago
framer.go 25847cfc30 handle the crypto stream separately in the packet packer 2 weeks ago
framer_test.go 25847cfc30 handle the crypto stream separately in the packet packer 2 weeks ago
interface.go 999516f8a9 fix comment for VersionGQUIC44 1 month ago
mint_utils.go f88b7bb175 implement the new Retry mechanism 2 months ago
mint_utils_test.go f88b7bb175 implement the new Retry mechanism 2 months ago
mock_ack_frame_source_test.go 7034481d9e get ACK and STOP_WAITING frames in the packet packer 2 weeks ago
mock_crypto_stream_test.go 25847cfc30 handle the crypto stream separately in the packet packer 2 weeks ago
mock_frame_source_test.go 25847cfc30 handle the crypto stream separately in the packet packer 2 weeks ago
mock_gquic_aead_test.go 302d2a1715 don't use trial decryption for IETF QUIC 6 months ago
mock_multiplexer_test.go c8d20e86d7 move listening from the multiplexer to the packet handler map 2 months ago
mock_packer_test.go 06db39836b move queueing of control frames to the framer 2 weeks ago
mock_packet_handler_manager_test.go ad5a3e2fa0 also use the multiplexer for the server 2 months ago
mock_packet_handler_test.go ad5a3e2fa0 also use the multiplexer for the server 2 months ago
mock_quic_aead_test.go 302d2a1715 don't use trial decryption for IETF QUIC 6 months ago
mock_quic_session_test.go f88b7bb175 implement the new Retry mechanism 2 months ago
mock_receive_stream_internal_test.go e802491a8f create internal interfaces for send and receive streams 9 months ago
mock_sealing_manager_test.go b000c32796 use a mock sealing manager in the packet packer tests 1 week ago
mock_send_stream_internal_test.go 25847cfc30 handle the crypto stream separately in the packet packer 2 weeks ago
mock_session_runner_test.go b3fd768a61 use a smaller packetHandler interface 3 months ago
mock_stream_getter_test.go e802491a8f create internal interfaces for send and receive streams 9 months ago
mock_stream_internal_test.go 25847cfc30 handle the crypto stream separately in the packet packer 2 weeks ago
mock_stream_manager_test.go da49295b52 expose methods for opening and accepting unidirectional streams 7 months ago
mock_stream_sender_test.go 2e8a5807ba queue stream-level window updates from the flow controller directly 5 months ago
mock_unknown_packet_handler_test.go ad5a3e2fa0 also use the multiplexer for the server 2 months ago
mock_unpacker_test.go a298bd01c9 use a gomock packet unpacker 6 months ago
mockgen.go b000c32796 use a mock sealing manager in the packet packer tests 1 week ago
mockgen_private.sh 76d4d43b50 move the mockgen cleanup commands to the mockgen script 2 months ago
multiplexer.go ad5a3e2fa0 also use the multiplexer for the server 2 months ago
multiplexer_test.go c8d20e86d7 move listening from the multiplexer to the packet handler map 2 months ago
packet_handler_map.go c0d4f00b20 implement gQUIC 44 1 month ago
packet_handler_map_test.go 46f8c07daa improve the version negotiation integration test 1 month ago
packet_number_generator.go b2aec3403e actually generate gaps in packet number space 3 days ago
packet_number_generator_test.go b2aec3403e actually generate gaps in packet number space 3 days ago
packet_packer.go 5df98dc389 split the packet packer into two structs, for gQUIC and for IETF QUIC 1 week ago
packet_packer_legacy.go 5df98dc389 split the packet packer into two structs, for gQUIC and for IETF QUIC 1 week ago
packet_packer_legacy_test.go 5df98dc389 split the packet packer into two structs, for gQUIC and for IETF QUIC 1 week ago
packet_packer_test.go 5df98dc389 split the packet packer into two structs, for gQUIC and for IETF QUIC 1 week ago
packet_unpacker.go 38efa84e9c use in place decryption for unpacking packets 6 months ago
packet_unpacker_test.go 302d2a1715 don't use trial decryption for IETF QUIC 6 months ago
quic_suite_test.go 759b0d87b1 refactor packet unpacking 10 months ago
receive_stream.go 8bd6168511 never increase the flow control limit for the crypto stream 4 weeks ago
receive_stream_test.go 5f5bb1f700 allow empty STREAM frames at arbitrary offsets 5 months ago
send_stream.go 25847cfc30 handle the crypto stream separately in the packet packer 2 weeks ago
send_stream_test.go 50397a979c only send BLOCKED frames if there is more data to send 2 months ago
server.go c0d4f00b20 implement gQUIC 44 1 month ago
server_session.go c0d4f00b20 implement gQUIC 44 1 month ago
server_session_test.go c0d4f00b20 implement gQUIC 44 1 month ago
server_test.go 2d10796bc2 stop the listener in the server unit tests 2 weeks ago
server_tls.go 2c75b795ae move adding of stateless reset tokens to the transport parameter struct 1 month ago
server_tls_test.go 9e83c96598 Merge pull request #1486 from lucas-clemente/send-ietf-quic-vnp 2 months ago
session.go 5df98dc389 split the packet packer into two structs, for gQUIC and for IETF QUIC 1 week ago
session_test.go b000c32796 use a mock sealing manager in the packet packer tests 1 week ago
stream.go 25847cfc30 handle the crypto stream separately in the packet packer 2 weeks ago
stream_test.go 50397a979c only send BLOCKED frames if there is more data to send 2 months ago
streams_map.go b40942d39e send stream counts, not stream IDs, in the transport parameters 7 months ago
streams_map_generic_helper.go f8d28a96fe close all streams when closing the IETF QUIC streams map 6 months ago
streams_map_incoming_bidi.go f8d28a96fe close all streams when closing the IETF QUIC streams map 6 months ago
streams_map_incoming_generic.go f8d28a96fe close all streams when closing the IETF QUIC streams map 6 months ago
streams_map_incoming_generic_test.go f8d28a96fe close all streams when closing the IETF QUIC streams map 6 months ago
streams_map_incoming_uni.go f8d28a96fe close all streams when closing the IETF QUIC streams map 6 months ago
streams_map_legacy.go 245af2c596 make the number of incoming streams configurable, for gQUIC 7 months ago
streams_map_legacy_test.go 286a51bcc0 run staticcheck in gometalinter 7 months ago
streams_map_outgoing_bidi.go f8d28a96fe close all streams when closing the IETF QUIC streams map 6 months ago
streams_map_outgoing_generic.go f8d28a96fe close all streams when closing the IETF QUIC streams map 6 months ago
streams_map_outgoing_generic_test.go f8d28a96fe close all streams when closing the IETF QUIC streams map 6 months ago
streams_map_outgoing_uni.go f8d28a96fe close all streams when closing the IETF QUIC streams map 6 months ago
streams_map_test.go b40942d39e send stream counts, not stream IDs, in the transport parameters 7 months ago
window_update_queue.go 8bd6168511 never increase the flow control limit for the crypto stream 4 weeks ago
window_update_queue_test.go 8bd6168511 never increase the flow control limit for the crypto stream 4 weeks 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.