var builder = WebApplication.CreateBuilder(args);
var socketName = "my.socket";
var socketPath = Path.Join(Path.GetTempPath(), socketName);
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
socketPath = Path.Join("/tmp", socketName);
if (File.Exists(socketPath))
File.Delete(socketPath);
// Configure Kestrel to listen at the UDS path
builder.WebHost.ConfigureKestrel(
opts => opts.ListenUnixSocket(socketPath));