From 5e9a72442fbe61b93258ee30f649b5cdf22ef482 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Fri, 30 Jun 2023 13:22:26 +0200 Subject: [PATCH] Remove HTTP/3 for go1.18 and below --- README.md | 11 ++--------- nethttp/http3.go | 2 ++ nethttp/http3_go1.18.go | 12 ++++++++++++ 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 nethttp/http3_go1.18.go diff --git a/README.md b/README.md index 8041bac..6ebf3e4 100644 --- a/README.md +++ b/README.md @@ -22,19 +22,12 @@ go install github.com/vearutop/plt@latest $(go env GOPATH)/bin/plt --help ``` -Or (with `go1.15` or older) - -``` -go get -u github.com/vearutop/plt -$(go env GOPATH)/bin/plt --help -``` - Or download binary from [releases](https://github.com/vearutop/plt/releases). ### Linux AMD64 ``` -wget https://github.com/vearutop/plt/releases/latest/download/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz && rm linux_amd64.tar.gz +wget -q https://github.com/vearutop/plt/releases/latest/download/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz && rm linux_amd64.tar.gz ./plt -version ``` @@ -68,7 +61,7 @@ For even better performance you can use `plt curl --fast` that will employ awesome [fasthttp](https://github.com/valyala/fasthttp) as transport. This mode lacks detailed breakdown of latencies, but can push request rate to the limit. -Use `--http2` or `--http3` for HTTP/2 or HTTP/3. +Use `--http2` for HTTP/2 or `--http3` for HTTP/3 (go1.19 or later). If the server is wrapped with Envoy proxy, upstream latency distribution will be collected from the values of [`X-Envoy-Upstream-Service-Time`](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-upstream-service-time) diff --git a/nethttp/http3.go b/nethttp/http3.go index a5334ef..9aa3c32 100644 --- a/nethttp/http3.go +++ b/nethttp/http3.go @@ -1,3 +1,5 @@ +//go:build go1.19 + package nethttp import ( diff --git a/nethttp/http3_go1.18.go b/nethttp/http3_go1.18.go new file mode 100644 index 0000000..2e445db --- /dev/null +++ b/nethttp/http3_go1.18.go @@ -0,0 +1,12 @@ +//go:build !go1.19 + +package nethttp + +import "net/http" + +// HTTP3Available guards HTTP3 library. +const HTTP3Available = false + +func (j *JobProducer) makeTransport3() http.RoundTripper { + return nil +}