{"id":1696,"date":"2016-02-17T23:50:11","date_gmt":"2016-02-17T18:20:11","guid":{"rendered":"http:\/\/judepereira.com\/blog\/?p=1696"},"modified":"2016-02-17T23:51:41","modified_gmt":"2016-02-17T18:21:41","slug":"mocking-the-http2-apple-push-notification-gateway-in-go","status":"publish","type":"post","link":"https:\/\/judepereira.com\/blog\/mocking-the-http2-apple-push-notification-gateway-in-go\/","title":{"rendered":"Mocking the HTTP\/2 Apple push notification gateway in Go"},"content":{"rendered":"<p>At <a href=\"http:\/\/clevertap.com\" target=\"_blank\">CleverTap<\/a>, 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.<\/p>\n<p>Go out of all languages! To me, Go has a completely strange syntax, compared to Java and C.<\/p>\n<p>This\u00a0mock server is hosted <a href=\"https:\/\/github.com\/CleverTap\/go-apns-server\" target=\"_blank\">here, on Github<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u00a0mock server [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[52],"tags":[548,551,569,565,550,566,568,552,567],"class_list":["post-1696","post","type-post","status-publish","format-standard","hentry","category-code","tag-apns","tag-apple","tag-gateway","tag-go","tag-http2","tag-mock","tag-notification","tag-push","tag-server"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pqtyx-rm","jetpack-related-posts":[{"id":1969,"url":"https:\/\/judepereira.com\/blog\/cloudflare-zero-trust-gateway-and-net-neutrality\/","url_meta":{"origin":1696,"position":0},"title":"Cloudflare Zero Trust Gateway and Net Neutrality","author":"Jude Pereira","date":"April 5, 2023","format":false,"excerpt":"Is Cloudflare ruining the entire concept of a distributed internet? Is it on a path to violate Net Neutrality? What can you do to prevent this?","rel":"","context":"In &quot;miscellaneous&quot;","block_context":{"text":"miscellaneous","link":"https:\/\/judepereira.com\/blog\/category\/misc\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screenshot-2023-04-04-at-20.01.01.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screenshot-2023-04-04-at-20.01.01.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screenshot-2023-04-04-at-20.01.01.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screenshot-2023-04-04-at-20.01.01.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screenshot-2023-04-04-at-20.01.01.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screenshot-2023-04-04-at-20.01.01.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":2055,"url":"https:\/\/judepereira.com\/blog\/colima-cloudflare-zero-trust-on-apple-silicon\/","url_meta":{"origin":1696,"position":1},"title":"Colima &#038; Cloudflare Zero Trust on Apple Silicon","author":"Jude Pereira","date":"March 18, 2024","format":false,"excerpt":"Install Colima via Homebrew: $ brew install colima $ colima start Add the Cloudflare Certificate Get inside the VM that Colima spawns: $ colima ssh jude@colima:\/Users\/Jude$ <\u2014 make sure that your prompt changes Download the Cloudflare Zero Trust certificate: $ sudo curl -k https:\/\/developers.cloudflare.com\/cloudflare-one\/static\/Cloudflare_CA.pem --output \/usr\/share\/ca-certificates\/cloudflare.crt $ sudo dpkg-reconfigure ca-certificates\u2026","rel":"","context":"In &quot;miscellaneous&quot;","block_context":{"text":"miscellaneous","link":"https:\/\/judepereira.com\/blog\/category\/misc\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1675,"url":"https:\/\/judepereira.com\/blog\/sending-notifications-via-apples-new-http2-api-using-jetty-9-3-6\/","url_meta":{"origin":1696,"position":2},"title":"Sending notifications via Apple&#8217;s new HTTP\/2 API (using Jetty 9.3.6)","author":"Jude Pereira","date":"January 9, 2016","format":false,"excerpt":"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\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1824,"url":"https:\/\/judepereira.com\/blog\/java-9s-httpclient-doesnt-allow-custom-http-2-authorization-headers\/","url_meta":{"origin":1696,"position":3},"title":"Java 9&#8217;s HttpClient doesn&#8217;t allow custom HTTP\/2 authorization headers","author":"Jude Pereira","date":"January 23, 2018","format":false,"excerpt":"TL;DR Java 9 HttpClient does not allow custom Authorization header unless you resort to a hack. Read more about my blog post on CleverTap's blog.","rel":"","context":"In &quot;miscellaneous&quot;","block_context":{"text":"miscellaneous","link":"https:\/\/judepereira.com\/blog\/category\/misc\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1830,"url":"https:\/\/judepereira.com\/blog\/ios-mac-ipsec\/","url_meta":{"origin":1696,"position":4},"title":"How to tunnel all traffic from your iOS device to your own server via IPSec","author":"Jude Pereira","date":"May 11, 2018","format":false,"excerpt":"TL;DR: A DigitalOcean droplet, strongSwan, and a custom Configuration Profile for iOS routes all the traffic from my iPhone via my droplet. Why? Just because I can. Note: This setup does not require you to download Apple Configurator and switch your iPhone into Supervised mode (we will create a configuration\u2026","rel":"","context":"In &quot;gnu linux&quot;","block_context":{"text":"gnu linux","link":"https:\/\/judepereira.com\/blog\/category\/linux\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32-1024x134.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1845,"url":"https:\/\/judepereira.com\/blog\/intellij-on-steroids-with-g1-gc\/","url_meta":{"origin":1696,"position":5},"title":"IntelliJ on steroids with G1 GC","author":"Jude Pereira","date":"June 15, 2018","format":false,"excerpt":"Lately, I noticed that IntelliJ started to pause for quite some time during it's GC cycles, and that it was very frequent when I was editing three files (over 1.2k LOC each) split vertically. The current version of IntelliJ runs on a bundled version of Java 1.8, who's default garbage\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/comments?post=1696"}],"version-history":[{"count":1,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1696\/revisions"}],"predecessor-version":[{"id":1697,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1696\/revisions\/1697"}],"wp:attachment":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/media?parent=1696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/categories?post=1696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/tags?post=1696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}