-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hosting Behind Cloudflare: Must be Grpc-Web/GrpcWebSocketBridge #3
Comments
I'll also look into this as I was not aware of this repo -> https://github.com/Cysharp/GrpcWebSocketBridge meanwhile if you already have a working example of magiconion working on http1, It would save me time in reading and implementing to the project |
Hello, Yes, our solution is already hosted and is being access via cloudflare. All we did is to replace channels with GrpcWebSocketBridge and it worked like charm. (Code is specific to our implementation, yours will differ as suggested below.) public class NativeGrpcClientChannel : IGrpcClient #To Create Client BTW, the only portion that changes is the highlighted code. You may to want to create another condition -http2Only for template flag. Default for -http2Only is false. If user passes --http2Only: true, (like you have done for -SSL) If required, ping me, I can drop a pull request. ;-) Happy to help you on this, have burnt my hands on Grpc Hosting a lot so can help a little. BTW, the client can run on Web, Blazor, or even Blazor MAUI. We have all cases in production. |
Hello Again!
Looking at the example solution, if we try to host and route requests through cloudflare.
The headers are not being returned.
Cloudflare does not support Http2 end to end.
More information here:
https://blog.cloudflare.com/road-to-grpc
The issues is
#if GRPC_SSL
#else
var channel = GrpcChannel.ForAddress(baseUrl);
#endif
#else
var channel = GrpcChannel.ForAddress(baseUrl);
#endif
In short anyone who is using cloudflare as proxy must use Grpc-Web Client or more apt with magic onion.
https://github.com/Cysharp/GrpcWebSocketBridge
[https://github.com/Cysharp/GrpcWebSocketBridge]
There must be a way to let client choose Client Channels to make this solution truly generic.
Great effort!
The text was updated successfully, but these errors were encountered: