mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-06-13 22:48:42 +00:00
RPC Test
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
using Echo;
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.WebHost.ConfigureKestrel(o =>
|
||||
{
|
||||
// Listen on 5300 and force HTTP/2 (h2c)
|
||||
o.ListenAnyIP(5300, lo => lo.Protocols = HttpProtocols.Http2);
|
||||
});
|
||||
|
||||
builder.Services.AddGrpc();
|
||||
var app = builder.Build();
|
||||
app.MapGrpcService<EchoServiceImpl>();
|
||||
app.Urls.Add("http://0.0.0.0:5300");
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user