Skip to content
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

Add support for grpc web #99

Closed
davidfowl opened this issue Feb 15, 2019 · 6 comments · Fixed by #695
Closed

Add support for grpc web #99

davidfowl opened this issue Feb 15, 2019 · 6 comments · Fixed by #695
Labels
needs design The issue requires design work to be completed before implementation
Milestone

Comments

@davidfowl
Copy link
Contributor

grpcWeb is a different protocol to grpc over HTTP/2. At some point we should add support for this.

https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md#protocol-differences-vs-grpc-over-http2

@JamesNK JamesNK added the needs design The issue requires design work to be completed before implementation label Feb 26, 2019
@JamesNK JamesNK added this to the Backlog milestone Mar 12, 2019
@ctaggart
Copy link

I want to be able to consume gRPC services from Blazor. You can read The state of gRPC in the browser. It is pretty easy to set up a gRPC-web proxy for a gRPC service, so it would be nice to be able to servce gRPC-web, but we can get by without out. What we really need is the gRPC-web client.

@JamesNK
Copy link
Member

JamesNK commented May 10, 2019

It would involve writing a custom CallInvoker, similar to the WIP managed .NET client.

There is nothing stopping someone writing one today in .NET Core 2.2. gRPC-web uses HTTP/1 tech which is fully supported by HttpClient.

@joshlang
Copy link

I vote for this feature.

We intend to do a simple protobuf-over-websocket thing in our blazor app. I'm insisting we call it GhettoRPC. It's relatively easy because we don't absolutely need advanced gRPC features. But it is rather silly, and we'd prefer grpcWeb.

@razfriman
Copy link

Would love support for this as well. I came up with a grpc-gateway-like solution where I convert calls so I could reach my api via Blazor WASM.

For anyone interested here is my project: https://github.com/razfriman/BlazorGrpc

@JamesNK
Copy link
Member

JamesNK commented Oct 22, 2019

Server in-process proxy guidance: https://github.com/grpc/grpc-web/blob/master/IN-PROCESS-PROXY.md

@Rora
Copy link

Rora commented Nov 12, 2019

For anyone looking to get a working gRPC server & client Blazor wasm app, I've created a simple proof of concept. The PoC uses a gRPC-web proxy hosted in a aspnet core service (KnowitSolutions created the gRPC-web proxy), and consumes it in the blazor wasm app using a basic CallInvoker (created by SteveSandersonMS).

The example does use grpc code first libraries, but is pretty easy to convert to the contract first setup. From the top of my head;

  1. Replace the protobuf-net.Grpc.AspNetCore nuget ref with the MS gRPC nuget ref
  2. Replace AddCodeFirstGrpc with AddGrpc in Startup.cs
  3. Create your service the contract first way
  4. new your client with the GrpcWebCallInvoker instead of using the ClientFactory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs design The issue requires design work to be completed before implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants