We’ve recently migrated to the new HTTP/2 API to send out push notifications to iOS devices, for greater throughput and reliability (as compared to the binary protocol).
As such, to stress test our system, we needed a mock HTTP/2 APNS server. Instinctively, we explored various ways to build one in Java, which is what most of our core system is written in. However, at this time, HTTP/2 support in Java seems to be very weak, with just a client available from the Jetty project.
Next up was Python, using the Hyper library. We wrote one inspired from the asyncio library example found here. For some reason, Jetty’s HTTP/2 transport library couldn’t play nicely with the Python server, however, the Chrome browser could. We didn’t have the time to investigate what was going on, and then we moved to Go.
Finally, using Go’s HTTP/2 library, we had our home-grown mock APNS server! For those of you who’d like to use it, we’ve hosted the code to it here, on GitHub.
Connect with CleverTap at Global Fintech Fest 2026
Discover how CleverTap helps financial brands optimize onboarding, drive retention, & scale user lifetime value at Global Fintech Fest 2026. Join our team from September 9–11 at Jio World Convention Centre, Mumbai. Stop by Booth R24 or book a meeting with our experts today.
Jude Pereira 
Principal Architect at CleverTap, working on TesseractDB™. He also contributes to the engineering culture, improving developer productivity.
Free Customer Engagement Guides
Join our newsletter for actionable tips and proven strategies to grow your business and engage your customers.