Open cyx opened 4 years ago
If I understand right, H2C is just http2 in cleartext, instead of using TLS. You should be able to do that by creating a client using an "insecure" credentials object (grpc.credentials.createInsecure()
).
If I understand right, H2C is just http2 in cleartext, instead of using TLS. You should be able to do that by creating a client using an "insecure" credentials object (grpc.credentials.createInsecure()).
I'm not so sure. My understanding is:
GET request is sent, with Connection: upgrade, Upgrade: h2c
headers.Here's the implementation for Go on the client side: https://github.com/lstoll/grpce/blob/master/h2c/dialer.go#L24-L85
In that case there probably isn't currently a way to do it.
I'm guessing that the implementation would be similar to the existing HTTP proxy traversal code (https://github.com/grpc/grpc-node/blob/master/packages/grpc-js/src/http_proxy.ts). Pull requests are welcome, but this would be a new feature that adds to the API, so it should also be accompanied by a proposal.
@murgatroid99 thanks for the response! While I would be happy to send a proposal, I don't think it's entirely necessary to be on the gRPC level unless I'm misunderstanding what you mean?
e.g. is there a way to just make this a third party extension which layers on top of the existing pure nodejs implementation?
I don't see a way to do it like that. Establishing a connection is a fairly low-level operation, and there aren't any API hooks to modify it.
Is your feature request related to a problem? Please describe.
For certain infrastructure setups doing H2C with load balancers that doesn't support http/2 is the only feasible option. Would be good to have a simple option to do this.
Describe the solution you'd like
Either a flag or a way to stub in a different channel implementation
Describe alternatives you've considered
Alternative is to change our infrastructure but it's not really as simple.
Additional context
Would be happy to help implement or just get direction how to do this cleanly.