http2push-gae icon indicating copy to clipboard operation
http2push-gae copied to clipboard

Implement Node drop-in lib

Open ebidel opened this issue 10 years ago • 10 comments

ebidel avatar Oct 14 '15 19:10 ebidel

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

silenceisgolden avatar Oct 30 '15 03:10 silenceisgolden

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.

ebidel avatar Oct 30 '15 16:10 ebidel

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.

silenceisgolden avatar Oct 30 '15 19:10 silenceisgolden

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?

ebidel avatar Oct 30 '15 19:10 ebidel

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

silenceisgolden avatar Oct 30 '15 19:10 silenceisgolden

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.

ebidel avatar Oct 30 '15 23:10 ebidel

@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.

silenceisgolden avatar Dec 01 '15 23:12 silenceisgolden

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

nevir avatar Feb 19 '16 04:02 nevir

@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.

silenceisgolden avatar Feb 19 '16 20:02 silenceisgolden

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

slightlyoff avatar Feb 26 '17 18:02 slightlyoff