Send Apple push notification from a Go appengine site : <p>I'm trying to send an Apple push notification from a Go appengine site. I'm using the <a href="https://godoc.org/github.com/sideshow/apns2" rel="noreferrer">apns2 library</a> as follows:</p>

<pre><code>cert, err := certificate.FromPemFile(pemFile, "")
if err != nil {
    log.Fatalf("cert error: %v", err)
}
client := apns2.NewClient(cert).Development()
n := &amp;apns2.Notification{...}
if res, err := client.Push(n); err != nil { ... }
</code></pre>

<p>On a local development server, it works fine; but in production I'm seeing:</p>

<pre><code>Post https://api.development.push.apple.com/3/device/995aa87050518ca346f7254f3484d7d5c731ee93c35e3c359db9ddf95d035003:
dial tcp: lookup api.development.push.apple.com on [::1]:53: dial udp [::1]:53: socket: operation not permitted
</code></pre>

<p>It looks like appengine expects you to use its own <a href="https://cloud.google.com/appengine/docs/go/outbound-requests" rel="noreferrer">urlfetch library</a> when sending outbound requests, so I tried setting the underlying <code>HTTPClient</code> to use that:</p>

<pre><code>client.HTTPClient = urlfetch.Client(ctx)
</code></pre>

<p>However, the response from the Apple server is now</p>

<pre><code>@@?HTTP/2 client preface string missing or corrupt. Hex dump for received bytes: 504f5354202f332f6465766963652f393935616138373035
</code></pre>

<p>I believe the problem is that Apple push notifications <a href="https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html" rel="noreferrer">require HTTP/2</a>, but urlfetch only implements HTTP/1.1.</p>

<p>How do I solve this problem? Is there a way for an appengine app to send an HTTP/2 request?</p>
