Skip to content

onyxg/http_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP 1.1 vs HTTP 2 Demo

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

About

HTTP 1 vs 2 demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published