GoogleChromeLabs / http2push-gae

Drop-in HTTP2 push on App Engine
https://http2-push.appspot.com/
Apache License 2.0
141 stars 18 forks source link

Implement Node drop-in lib #11

Open ebidel opened 9 years ago

silenceisgolden commented 9 years ago

If it helps, working on a version of this for koa right now.

ebidel commented 9 years ago

Would be interested to see. I think for this, we'll need a docker setup that runs a Node server on Google Cloud Engine. That way, it gets you on Google's infrastructure and serving http2. I'm not sure the current state of affairs with Node libs and http2.

silenceisgolden commented 9 years ago

If I understand this right, h2 isn't explicitly needed for App Engine since all h2 requests are sent as 1.1 to the app, then converted back to h2 on the proxy layer. However, there are libs such as https://github.com/molnarg/node-http2 that have great support, and ALPN just landed in node 5.0.0. At the very least the node lib would have to add the appropriate Link and X-Associated-Content headers like your python library does. Another hiccup I passed was setting multiple of the same header, but that is fixed by passing an array into setHeaders (through whichever framework you use). I would imagine that just Koa and Express would need middleware since a lot is built on those 2 frameworks.

However, right now I'm running gcloud preview app deploy app.yaml and getting ERROR: (gcloud.preview.app.deploy) Error Response: [4] Timed out creating VMs.... so yeah. Trying to figure out how to debug this issue, documentation is very poor.

ebidel commented 9 years ago

Another hiccup I passed was setting multiple of the same header

Yea, this needs to be tested to see if both or only one way works.

Which docs are poor?

silenceisgolden commented 9 years ago

The gcloud CLI docs. I'm kind of baffled with the random 404 and Timed Out errors I'm getting at the moment. The hello world app ran fine, but so far nothing else has and I can't seem to have the right google-fu to find someone who also had these issues. Why aren't there debug flags all over the place? Right now I'm just creating versions but have no way to see why the app is not starting. The front end error is at https://logically-abstract-www-site.appspot.com/.

In node you can set your string to a header, or use an array to tell node to set multiple of the same header. https://nodejs.org/api/http.html#http_response_setheader_name_value

Edit: waiting for this to get looked at http://stackoverflow.com/questions/33444347/unable-to-update-vm-with-nodejs-app-on-google-app-engine

ebidel commented 9 years ago

I had troubles deploying a py app yesterday. The fix was gcloud config set app/use_appengine_api false until the next SDk update. Not sure if that will help you.

silenceisgolden commented 8 years ago

@ebidel https://www.npmjs.com/package/koa-server-push is ready to get some people testing it if you'd like to give it a go.

nevir commented 8 years ago

If that gets some uptake, it'd be interesting to see koa-server-push integrating directly with https://github.com/GoogleChrome/http2-push-manifest to figure out which resources to push on the fly

silenceisgolden commented 8 years ago

@nevir As good as that would be for node users, https://github.com/GoogleChrome/http2-push-manifest has a scope to create the manifest, and https://github.com/silenceisgolden/koa-server-push has the scope to consume the manifest and apply the appropriate headers. Since the libraries have different scopes (and libraries exist for other languages with the same scope as https://github.com/silenceisgolden/koa-server-push), it makes sense to keep the scope of https://github.com/GoogleChrome/http2-push-manifest as it stands right now, and allow people to integrate the tools as needed.

slightlyoff commented 7 years ago

I'm working on this. Can someone please assign the issue to me?