Skip to content

Instantly share code, notes, and snippets.

@usausa
Created October 1, 2023 12:04
Show Gist options
  • Save usausa/1189ee926bbc3efd2e23b75079d63eb6 to your computer and use it in GitHub Desktop.
Save usausa/1189ee926bbc3efd2e23b75079d63eb6 to your computer and use it in GitHub Desktop.
TCP server using Microsoft.AspNetCore.Connections
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseKestrel(options =>
{
options.ListenLocalhost(9999, config =>
{
config.UseConnectionHandler<MyConnectionHandler>();
});
});
var app = builder.Build();
app.Run();
// Microsoft.AspNetCore.Server.Kestrel: Warning: Overriding address(es) 'https://localhost:5001/, http://localhost:5000/'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead. を消したい
// Microsoft.Hosting.Lifetime: Information: Now listening on: http://localhost:8007 とログがhttpで表示されてしまう
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment