A QUIC implementation in pure go

Marten Seemann 27a226980c Merge pull request #1920 from lucas-clemente/insecure-client 22 hours ago
.circleci c00eb1f5b5 add Go mod support 2 months ago
.travis b52d45a1e5 use GolangCI-Lint instead of gometalinter 2 months ago
benchmark 8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 10 months ago
docs ef71186402 add gopher-logo 3 years ago
example 27a226980c Merge pull request #1920 from lucas-clemente/insecure-client 22 hours ago
http3 1bf489b7af open a control stream and send a SETTINGS frame as an H3 server 1 day ago
integrationtests de6ab88437 add support for gzipped HTTP/3 requests 1 month ago
internal fd33eb319f add a flag to turn off PRR 1 day ago
.editorconfig 2e1da961c5 add editorconfig 3 years ago
.gitignore c3da72d498 add debug.test (dvelve output) to gitignore 3 years ago
.golangci.yml 4f6d0e651a implement HTTP/3 1 month ago
.travis.yml c00eb1f5b5 add Go mod support 2 months ago
Changelog.md 5080afeac3 add a Changelog entry for HTTP/3 1 month ago
LICENSE bd3c7a96f9 add Google to license file 2 years ago
README.md 4f6d0e651a implement HTTP/3 1 month ago
appveyor.yml c00eb1f5b5 add Go mod support 2 months ago
buffer_pool.go 33bf79c735 fix packet buffer usage when handling coalesced packets 2 months ago
buffer_pool_test.go 33bf79c735 fix packet buffer usage when handling coalesced packets 2 months ago
client.go 6c27967c8a include the timer granularity in the advertised max_ack_delay 2 weeks ago
client_test.go 94046cdb4b implement sending of stateless resets 2 months ago
codecov.yml de6ab88437 add support for gzipped HTTP/3 requests 1 month 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 5 months ago
crypto_stream.go e7ed5e3c92 implement the crypto stream for post-handshake crypto messages 3 months ago
crypto_stream_manager.go 2adf923ee6 process the NewSessionTicket TLS message 1 month ago
crypto_stream_manager_test.go 2adf923ee6 process the NewSessionTicket TLS message 1 month ago
crypto_stream_test.go e7ed5e3c92 implement the crypto stream for post-handshake crypto messages 3 months ago
frame_sorter.go 1864e301ef move tracking of the final stream offset to the stream 3 months ago
frame_sorter_test.go 1864e301ef move tracking of the final stream offset to the stream 3 months ago
framer.go dba964f735 fix packing of maximum-size packets 3 weeks ago
framer_test.go dba964f735 fix packing of maximum-size packets 3 weeks ago
go.mod 4f6d0e651a implement HTTP/3 1 month ago
go.sum 4f6d0e651a implement HTTP/3 1 month ago
interface.go 0a86224858 pass a string, not an error, to Session.CloseWithError 1 week ago
mock_ack_frame_source_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_crypto_data_handler_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_crypto_stream_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_frame_source_test.go 109bb3fe62 pass the length of the packet being packet around in the packet packer 1 month ago
mock_multiplexer_test.go 94046cdb4b implement sending of stateless resets 2 months ago
mock_packer_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_packet_handler_manager_test.go 94046cdb4b implement sending of stateless resets 2 months ago
mock_packet_handler_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_quic_session_test.go 0a86224858 pass a string, not an error, to Session.CloseWithError 1 week ago
mock_receive_stream_internal_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_sealing_manager_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_send_stream_internal_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_session_runner_test.go 94046cdb4b implement sending of stateless resets 2 months ago
mock_stream_getter_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_stream_internal_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_stream_manager_test.go 51c9c42adc reject transport parameters with too large stream counts 1 month ago
mock_stream_sender_test.go 5e34cb1d71 run go generate ./... 2 months ago
mock_unknown_packet_handler_test.go dc75123836 fix race condition when closing the server after a Read failed 1 week ago
mock_unpacker_test.go 5e34cb1d71 run go generate ./... 2 months ago
mockgen.go 67f923c736 return the Opener from the crypto setup 5 months ago
mockgen_private.sh 76d4d43b50 move the mockgen cleanup commands to the mockgen script 9 months ago
multiplexer.go 94046cdb4b implement sending of stateless resets 2 months ago
multiplexer_test.go 94046cdb4b implement sending of stateless resets 2 months ago
packet_handler_map.go dc75123836 fix race condition when closing the server after a Read failed 1 week ago
packet_handler_map_test.go b3fe0fdbf9 only send stateless resets if a stateless reset key is configured 2 months ago
packet_packer.go dba964f735 fix packing of maximum-size packets 3 weeks ago
packet_packer_test.go dba964f735 fix packing of maximum-size packets 3 weeks ago
packet_unpacker.go 855b643c7c move frame parsing to the session 4 months ago
packet_unpacker_test.go 28ed85b9c6 move cutting of coalesced packets to the wire package 2 months ago
quic_suite_test.go 3266e36811 drop support for gQUIC 6 months ago
receive_stream.go 2787a6051a remove some defer statements in the stream 3 months ago
receive_stream_test.go ca939df44e remove the error return value from Stream.CancelRead 3 months ago
send_stream.go 9b5a20e772 remove some unused functions 2 months ago
send_stream_test.go 3372fa794c remove the error return value from Stream.CancelWrite 3 months ago
server.go 369b9bc6d5 Merge pull request #1892 from lucas-clemente/max-ack-delay 1 week ago
server_test.go dc75123836 fix race condition when closing the server after a Read failed 1 week ago
session.go 555737bbc2 fix logging of sent ACK frames 2 days ago
session_test.go 0a86224858 pass a string, not an error, to Session.CloseWithError 1 week ago
stream.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 6 months ago
stream_test.go 3266e36811 drop support for gQUIC 6 months ago
streams_map.go 51c9c42adc reject transport parameters with too large stream counts 1 month ago
streams_map_generic_helper.go 9518c90c0a implement and use the MAX_STREAMS frame 6 months ago
streams_map_incoming_bidi.go f17ddffb70 don't delete a stream until it has been accepted 3 months ago
streams_map_incoming_generic.go f17ddffb70 don't delete a stream until it has been accepted 3 months ago
streams_map_incoming_generic_test.go f17ddffb70 don't delete a stream until it has been accepted 3 months ago
streams_map_incoming_uni.go f17ddffb70 don't delete a stream until it has been accepted 3 months ago
streams_map_outgoing_bidi.go 9c09e84765 use IETF QUIC transport error codes 2 months ago
streams_map_outgoing_generic.go 9c09e84765 use IETF QUIC transport error codes 2 months ago
streams_map_outgoing_generic_test.go 9c09e84765 use IETF QUIC transport error codes 2 months ago
streams_map_outgoing_uni.go 9c09e84765 use IETF QUIC transport error codes 2 months ago
streams_map_test.go 51c9c42adc reject transport parameters with too large stream counts 1 month ago
window_update_queue.go 8bd6168511 never increase the flow control limit for the crypto stream 8 months ago
window_update_queue_test.go 8bd6168511 never increase the flow control limit for the crypto stream 8 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 ./...

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.