Grpc.AspNetCore.Web 2.61.0
Grpc.AspNetCore.Web
Grpc.AspNetCore.Web provides middleware that enables ASP.NET Core gRPC services to accept gRPC-Web calls.
Configure gRPC-Web
In Program.cs:
using GrpcGreeter.Services;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddGrpc();
var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseRouting();
app.UseGrpcWeb(new GrpcWebOptions { DefaultEnabled = true });
app.MapGrpcService<GreeterService>();
app.Run();
gRPC-Web can be enabled for all gRPC services by setting GrpcWebOptions.DefaultEnabled = true, or enabled on individual services with EnableGrpcWeb():
app.MapGrpcService<GreeterService>().EnableGrpcWeb();
gRPC-Web and streaming
Traditional gRPC over HTTP/2 supports streaming in all directions. gRPC-Web offers limited support for streaming:
- gRPC-Web browser clients don't support calling client streaming and bidirectional streaming methods.
 - gRPC-Web .NET clients don't support calling client streaming and bidirectional streaming methods over HTTP/1.1.
 - ASP.NET Core gRPC services hosted on Azure App Service and IIS don't support bidirectional streaming.
 
When using gRPC-Web, we only recommend the use of unary methods and server streaming methods.
Links
Showing the top 20 packages that depend on Grpc.AspNetCore.Web.
| Packages | Downloads | 
|---|---|
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                158 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                103 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                78 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                56 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                53 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                52 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                48 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                41 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                37 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                30 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                27 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                26 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                24 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                23 | 
| 
                                                    CH.Web.Core
                                                     OHL.Web.Core 
                                                 | 
                                                22 | 
.NET 6.0
- No dependencies.
 
.NET 7.0
- No dependencies.
 
.NET 8.0
- No dependencies.
 
| Version | Downloads | Last updated | 
|---|---|---|
| 2.61.0 | 215 | 06/05/2024 |