Example of enabling HTTP/2 in Finagle via toggle.
Run the server with:
$ sbt "runMain com.jcreixell.finaglehttp2.Server"
Test it with curl
(make sure it is compiled with support for nghttp2):
$ curl --http2 -v localhost:8080
Run the client with:
$ sbt "runMain com.jcreixell.finaglehttp2.Client"
To test it, you can use netcat. Before running the client:
nc -l -p 8080
You should see the upgrade headers:
upgrade: h2c
HTTP2-Settings: AAEAABAAAAIAAAABAAN_____AAQAAP__AAUAAEAAAAYAACAA
connection: HTTP2-Settings,upgrade
For benchmarking, you can use h2load (part of nghttp2):
For HTTP/1.1:
h2load --h1 -n100000 -c100 -m10 http://localhost:8080
For HTTP/2:
h2load -n100000 -c100 -m10 http://localhost:8080