-
./cmd/h2srv
=> Go Http Server -
./cmd/h2go
=> Go Http Client -
./src/main.rs
=> Rust Http Client
A simple REST API which expects byte buffer in a body and responds back length of the buffer in a json.
Example: Send "hello" and get its length back
$ echo hello | curl -X POST -k --http2 --data-binary @- $HTEST_URL
{"Len":6}
- Generate certs first (openssl needed)
cd certs
bash ../gencert.sh
- Build server
go build ./cmd/h2srv
- Build go client
go build ./cmd/h2go
- Build rust client
cargo build --release
- Running server
./h2srv
- Running Rust Client
source test.env
./target/release/hyper-stuck
- Running Go client
export GODEBUG=x509ignoreCN=0
./h2go
The are in the file test.env
. They are:
# The URL to connect to
export HTEST_URL=https://127.0.0.1:9001/put
# The number outstanding requests. 1 future => 1 request
export HTEST_FUT_LIMIT=400
# Number of requests to be made
export HTEST_REQ_COUNT=100000
# Size of the buffer sent in each request (below is 256KB)
export HTEST_BUF_SIZE=$((256*1024))
# Number of connections. In hyper, this will create as many hyper::client::Client instances
export HTEST_CONN_COUNT=1