A QUIC implementation in pure go

Marten Seemann de05de297f Merge pull request #1739 from lucas-clemente/connection-state 1 day ago
.circleci 598a796e24 only run integration tests with race detector on Go 1.11 on CircleCI 1 month ago
.travis 3f3fe2b4d9 fix Travis configuration to actually run the integration tests 2 months ago
benchmark 8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 6 months ago
docs ef71186402 add gopher-logo 2 years ago
example f6357dc858 use the self-signed certificate for the example server and client 1 month ago
h2quic ae385e776c remove an old Go 1.8 test case 3 weeks ago
integrationtests 2cb72ad098 Merge pull request #1710 from lucas-clemente/proxy-remove-version 1 week ago
internal de05de297f Merge pull request #1739 from lucas-clemente/connection-state 1 day ago
vendor ad3f39a5d7 retrieve the handshake write key when receiving the ServerHello 1 week 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 5 months ago
.travis.yml 4abcce6408 use a self-signed certificate for integration tests 1 month ago
Changelog.md bbe8c64cb7 release 0.10 4 months ago
LICENSE bd3c7a96f9 add Google to license file 2 years ago
README.md 3266e36811 drop support for gQUIC 2 months ago
appveyor.yml 4abcce6408 use a self-signed certificate for integration tests 1 month ago
buffer_pool.go b32fb438af make putting back packet buffers a member function of packetBuffer 2 weeks ago
buffer_pool_test.go b32fb438af make putting back packet buffers a member function of packetBuffer 2 weeks ago
client.go 178ac0dacb keep increasing the packet number after version negotiation and retry 3 weeks ago
client_test.go 178ac0dacb keep increasing the packet number after version negotiation and retry 3 weeks ago
codecov.yml 7346d12d6c use Genny to generate typed lists, based on Go standard library code 9 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 1 month ago
crypto_stream.go 387c28d707 when the encryption level changes, reject data on that crypto stream 2 months ago
crypto_stream_manager.go b63c81f0bf try decrypting undecryptable packets when the encryption level changes 2 months ago
crypto_stream_manager_test.go b63c81f0bf try decrypting undecryptable packets when the encryption level changes 2 months ago
crypto_stream_test.go 387c28d707 when the encryption level changes, reject data on that crypto stream 2 months ago
frame_sorter.go 387c28d707 when the encryption level changes, reject data on that crypto stream 2 months ago
frame_sorter_test.go 387c28d707 when the encryption level changes, reject data on that crypto stream 2 months ago
framer.go 82508f1562 use tls-tris instead of mint 2 months ago
framer_test.go 387613aa20 rename the BLOCKED from to DATA_BLOCKED 2 months ago
interface.go a2e48e204b return a net.Error when opening streams 1 week ago
mock_ack_frame_source_test.go a303ad9745 always send ACKs in the correct packet number space 1 week ago
mock_crypto_data_handler_test.go e0bc72451b fix the file name of the mock crypto data handler 2 months ago
mock_crypto_stream_test.go 387c28d707 when the encryption level changes, reject data on that crypto stream 2 months ago
mock_frame_source_test.go 25847cfc30 handle the crypto stream separately in the packet packer 3 months ago
mock_multiplexer_test.go 1a0aa50471 delete unused connections from the multiplexer 4 days ago
mock_packer_test.go 06db39836b move queueing of control frames to the framer 3 months ago
mock_packet_handler_manager_test.go 65cca7b726 immediately remove sessions that were closed remotely 2 months ago
mock_packet_handler_test.go c5ca6fd7e5 parse the extended header in the session 1 month ago
mock_quic_session_test.go 178ac0dacb keep increasing the packet number after version negotiation and retry 3 weeks ago
mock_receive_stream_internal_test.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 2 months ago
mock_sealing_manager_test.go 3266e36811 drop support for gQUIC 2 months ago
mock_send_stream_internal_test.go 25847cfc30 handle the crypto stream separately in the packet packer 3 months ago
mock_session_runner_test.go 65cca7b726 immediately remove sessions that were closed remotely 2 months ago
mock_stream_getter_test.go e802491a8f create internal interfaces for send and receive streams 1 year ago
mock_stream_internal_test.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 2 months ago
mock_stream_manager_test.go 9518c90c0a implement and use the MAX_STREAMS frame 2 months ago
mock_stream_sender_test.go 2e8a5807ba queue stream-level window updates from the flow controller directly 8 months ago
mock_unknown_packet_handler_test.go ad5a3e2fa0 also use the multiplexer for the server 5 months ago
mock_unpacker_test.go aaea375fb6 move parsing of the extended header to the unpacker 1 month ago
mockgen.go 67f923c736 return the Opener from the crypto setup 1 month ago
mockgen_private.sh 76d4d43b50 move the mockgen cleanup commands to the mockgen script 5 months ago
multiplexer.go 1a0aa50471 delete unused connections from the multiplexer 4 days ago
multiplexer_test.go c8d20e86d7 move listening from the multiplexer to the packet handler map 5 months ago
packet_handler_map.go 1a0aa50471 delete unused connections from the multiplexer 4 days ago
packet_handler_map_test.go 1a0aa50471 delete unused connections from the multiplexer 4 days ago
packet_packer.go a303ad9745 always send ACKs in the correct packet number space 1 week ago
packet_packer_test.go a303ad9745 always send ACKs in the correct packet number space 1 week ago
packet_unpacker.go 855b643c7c move frame parsing to the session 2 weeks ago
packet_unpacker_test.go 855b643c7c move frame parsing to the session 2 weeks ago
quic_suite_test.go 3266e36811 drop support for gQUIC 2 months ago
receive_stream.go 0be8e033ab fix race conditions when setting read and write deadlines 4 weeks ago
receive_stream_test.go 0be8e033ab fix race conditions when setting read and write deadlines 4 weeks ago
send_stream.go 0be8e033ab fix race conditions when setting read and write deadlines 4 weeks ago
send_stream_test.go 0be8e033ab fix race conditions when setting read and write deadlines 4 weeks ago
server.go 181aa493e0 make sure not to return closed session from Listener.Accept() 1 week ago
server_session.go c5ca6fd7e5 parse the extended header in the session 1 month ago
server_session_test.go c5ca6fd7e5 parse the extended header in the session 1 month ago
server_test.go 181aa493e0 make sure not to return closed session from Listener.Accept() 1 week ago
session.go a303ad9745 always send ACKs in the correct packet number space 1 week ago
session_test.go a303ad9745 always send ACKs in the correct packet number space 1 week ago
stream.go 022189dfda rename the RST_STREAM frame to RESET_STREAM frame 2 months ago
stream_test.go 3266e36811 drop support for gQUIC 2 months ago
streams_map.go a2e48e204b return a net.Error when opening streams 1 week ago
streams_map_generic_helper.go 9518c90c0a implement and use the MAX_STREAMS frame 2 months ago
streams_map_incoming_bidi.go 9518c90c0a implement and use the MAX_STREAMS frame 2 months ago
streams_map_incoming_generic.go 9518c90c0a implement and use the MAX_STREAMS frame 2 months ago
streams_map_incoming_generic_test.go 9518c90c0a implement and use the MAX_STREAMS frame 2 months ago
streams_map_incoming_uni.go 9518c90c0a implement and use the MAX_STREAMS frame 2 months ago
streams_map_outgoing_bidi.go a2e48e204b return a net.Error when opening streams 1 week ago
streams_map_outgoing_generic.go a2e48e204b return a net.Error when opening streams 1 week ago
streams_map_outgoing_generic_test.go a2e48e204b return a net.Error when opening streams 1 week ago
streams_map_outgoing_uni.go a2e48e204b return a net.Error when opening streams 1 week ago
streams_map_test.go a2e48e204b return a net.Error when opening streams 1 week ago
window_update_queue.go 8bd6168511 never increase the flow control limit for the crypto stream 4 months ago
window_update_queue_test.go 8bd6168511 never increase the flow control limit for the crypto stream 4 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.