High level client for golang http2 server push
Asked Answered
I

1

5

golang 1.6 was released with Http2 support. I googled online but couldn't find any examples of how to do Http2 server push using Go. Is there any high level client implemented for that? Is there any examples that people have already done?

Inconsistency answered 17/6, 2016 at 4:1 Comment(5)
Just for reminding: HTTP/2 server push was already supported by go1.8.Joellenjoelly
@Joellenjoelly Go 1.8 is due on 31.01.2017, so this is in beta ( though fairly stable ). See github.com/golang/go/milestone/38Fibered
shameless self promotion : github.com/romainmenke/pusher. It is a middleware handler to generate push promisesBrussels
@RMenke thanks for you promote, is golang 1.8 public yet?Inconsistency
It will be released 31/01. So not long until then. You can go through the pkg and run the example with the beta release of go. (as with all beta's you should be careful not to mess up your dev environment) The idea is pretty simply. When a certain resource is requested you also push the urls of dependencies. These urls will then be handled by your server. A bit like a redirect.Brussels
L
1

The http2 implementation in the std library doesn't expose http2-specific interfaces, however you can use golang.org/x/net/http2 directly.

https://godoc.org/golang.org/x/net/http2#Framer.WritePushPromise

Lixiviate answered 17/6, 2016 at 4:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.