Skip to content

oksusucode/http2

Repository files navigation

A Go implementation of the HTTP/2 protocol.

It is useful for client/server application development using the HTTP/2 connection/stream directly.

currently under heavy development.

Features

  • Server/Client Connection
  • Negotiation (ALPN, Upgrade)
  • Flow Control
  • Multiplexing without head-of-line blocking
  • Graceful Shutdown

Requirements

  • Golang 1.5+

Installation

go get github.com/nekolunar/http2

Documentation

Benchmarks

  • 2.2 GHz Intel Core i7
  • 16 GB 1600 MHz DDR3
  • Concurrency: C(1|8|64|512)
  • Request/Response Data Length: 1024 Bytes

HTTP/2 over TLS (ALPN)

go test -bench BenchmarkConnReadWriteTLS -benchmem

BenchmarkConnReadWriteTLS_1K_C1-8      50000         33666 ns/op        4083 B/op         32 allocs/op
BenchmarkConnReadWriteTLS_1K_C8-8      50000         34544 ns/op        4080 B/op         32 allocs/op
BenchmarkConnReadWriteTLS_1K_C64-8     50000         34277 ns/op        4058 B/op         32 allocs/op
BenchmarkConnReadWriteTLS_1K_C512-8    50000         33966 ns/op        3880 B/op         30 allocs/op

HTTP/2 over TCP (Upgrade)

go test -bench BenchmarkConnReadWriteTCP -benchmem

BenchmarkConnReadWriteTCP_1K_C1-8      50000         30090 ns/op        4065 B/op         32 allocs/op
BenchmarkConnReadWriteTCP_1K_C8-8      50000         30610 ns/op        4062 B/op         32 allocs/op
BenchmarkConnReadWriteTCP_1K_C64-8     50000         30673 ns/op        4040 B/op         32 allocs/op
BenchmarkConnReadWriteTCP_1K_C512-8   100000         30715 ns/op        3965 B/op         31 allocs/op

License

MIT license. See LICENSE for details.

About

HTTP/2 for The Go programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages