At CleverTap, we had the need to mock the new HTTP/2 Apple push gateway API. After trying to do this in Java, and then in Python, I succeeded in getting it to work in Go.
Go out of all languages! To me, Go has a completely strange syntax, compared to Java and C.
This mock server is hosted here, on Github.
HTTP/2 is still very much new to Java, and as such, there are just two libraries who support it – Jetty (from 9.3), and Netty (in alpha). If you’re going the Jetty way (as I have), you’ll need to add their ALPN library to your boot classpath.
Note: Jetty 9.3.x requires the use of Java 8.
A full library for this is available here, on GitHub.
Here’s a quick example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters