From 93bbf59b2463eb4f80d9f6b44b42c91d7c7e7ca7 Mon Sep 17 00:00:00 2001 From: Bela VanderVoort Date: Mon, 19 Feb 2024 13:18:01 -0600 Subject: [PATCH] To avoid windows firewall warnings when running csharpier as a server, bind it to the loopback address (#1184) --- Src/CSharpier.Cli/ServerFormatter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/CSharpier.Cli/ServerFormatter.cs b/Src/CSharpier.Cli/ServerFormatter.cs index 497734edf..ff217cd58 100644 --- a/Src/CSharpier.Cli/ServerFormatter.cs +++ b/Src/CSharpier.Cli/ServerFormatter.cs @@ -22,9 +22,10 @@ CancellationToken cancellationToken builder.WebHost.ConfigureKestrel( (_, serverOptions) => { - serverOptions.Listen(IPAddress.Any, thePort); + serverOptions.Listen(IPAddress.Loopback, thePort); } ); + var app = builder.Build(); var service = new CSharpierServiceImplementation(actualConfigPath, logger); app.MapPost(