Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can httptest be used to test HTTP/2?

I'm wondering if this (httptest) package can be used to test HTTP/2 specific features.
Can anyone point me to some examples maybe?

I'm aware of the tool h2i, but it's an interactive tool.
I'm looking for something which is programmable.

EDIT:
What I'm really looking for is a tool, where for example I can initiate a server push and test it on the client side.
So, using this package, how do I have access to the underlying HTTP/2 stuff it uses by default?

EDIT 2:
Found some examples in the nghttp2 source: https://github.com/tatsuhiro-t/nghttp2/tree/master/integration-tests

EDIT 3: For me it looks like that the package net/http2 isn't meant to be used directly by anyone. I'll experiment with this one.

like image 636
otisonoza Avatar asked Feb 22 '16 15:02

otisonoza


People also ask

How do I check for HTTP 2?

Google Chrome offers a quick and easy way to check if HTTP/2 is supported on your SSL-enabled site. First, visit your site in Chrome over HTTPS. There you'll see your site listed with protocol h2, confirming your site works over HTTP/2.

How do I change http1 to http2?

So, most browsers has done its part and you might need to check and upgrade your server. Head over to one of your favourite site > dev tools > network tab > right click and enable the protocol tab and see which protocol version is being used. I picked a sample from facebook and they use HTTP/2.


1 Answers

General testing tip (to avoid frustration)!

Don't use Fiddler to test it, it gets in between your browser and the server and breaks the HTTP2 connection.

No HTTP2 - no push.

like image 192
Simon_Weaver Avatar answered Oct 25 '22 04:10

Simon_Weaver