knative / docs

User documentation for Knative components.
https://knative.dev/docs/
Other
4.54k stars 1.23k forks source link

Add docs for .NET Core unencrypted HTTP2 (h2c) #2750

Closed EatonZ closed 3 years ago

EatonZ commented 4 years ago

If the underlying Cloud Run application supports h2c, HTTP2 can be used all the way through.

I was looking into this for .NET Core and while I found some promising info to enable h2c on .NET Core's Kestrel, I wasn't able to get it working (Cloud Run logs were saying "The request failed because either the HTTP response was malformed or connection to the instance had an error.").

I didn't follow the above linked example code exactly. I tried this: webBuilder.ConfigureKestrel(options => options.ConfigureEndpointDefaults(o => o.Protocols = HttpProtocols.Http2)); ...but that doesn't appear to be correct.

I would like to request that a small note be added to the .NET Core tutorial/sample with instructions on how to set up h2c. I might be missing something simple, in that case great, but it would also be great to have this info published for other customers to benefit.

EatonZ commented 4 years ago

I think I found the issue - it doesn't look like the application is actually receiving HTTP2 data. There is a --use-http2 flag in gcloud run deploy, but it's restricted to Anthos.😡

I believe my code is the correct way to go about doing this, but it won't work until this Cloud Run (Fully Managed) limitation is removed.

ahmetb commented 4 years ago

I'd say documenting how to listen on h2c isn't the right place for Knative, however it would be indeed good for Knative to explain and document how h2c can be configured (in knative case, it's done by naming the port as h2c in containers[0].ports section).

EatonZ commented 4 years ago

@ahmetb There are samples here to which info could be added.

ahmetb commented 4 years ago

But those samples aren't h2c (GRPC/Websockets). :) They're lean and simple for a reason like they're the per-language hello world samples. Adding h2c there is not the right idea.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen.Mark the issue as fresh by adding the comment /remove-lifecycle stale.