A simple demo to show the difference between HTTP 1.1 and HTTP 2. Go's default net/http package supports HTTP 2 out of the box, however will only use HTTP 2 if the server has TLS enabled.
Start HTTP 1.1 server on port localhost:9001
go run main.go
Start HTTP 2 server on port localhost:9002
HTTP2=true go run main.go
Uses a self-signed certificate.
Run the following command to the see HTTP 1.1 / Established connections
netstat -an | grep 9001
Run the following command to the see the HTTP 2 / Established connections
netstat -an | grep 9002