I am trying to write a Go client to test our http/2 infrastructure. I would like to make an http request to https://mydomain.tld/somePage
and expect to receive an html response, along with several pushed resources. I would like to ensure those pushes are successful, and fail if they are not.
It is not clear to me if any part of the standard library exposes this functionality I need.
I can look at the response and check the protocol version to detect http2.
I can see Link
headers in responses from sites like https://http2-push.appspot.com/ that send pushes, but I'm not quite clear on the relationship between Link headers and actual Push Promise frames. You can get link headers over http 1.1, so I'm not sure that alone ensures a push will happen.
The http2 package has a lower level Framer
interface that I may be able to leverage to verify the raw frames, but honestly, I have no idea how to set one up and issue the initial request to it.
Is there any example of how a go client can verify the proper configuration of http2 pushed resources?