From 4a5bc2457959b8e445f6a651cc0f5153d49b2baf Mon Sep 17 00:00:00 2001 From: ZhaoLei Date: Thu, 17 Oct 2024 15:24:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=20=E4=B8=8D=E5=9C=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E7=BB=91=E5=AE=9Aurl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IIS托管时,代码中指定 Urls 将导致无法启动错误 ```csharp //app.Urls.Clear(); //app.Urls.Add("http://0.0.0.0:6819"); ``` 无代理时使用 .\LocalServer.exe --urls="http://0.0.0.0:6818" 绑定 固定url --- Server/LocalServer/Program.cs | 8 +++++--- Server/RemoteServer/Program.cs | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Server/LocalServer/Program.cs b/Server/LocalServer/Program.cs index e0b2d86..6a7fa93 100644 --- a/Server/LocalServer/Program.cs +++ b/Server/LocalServer/Program.cs @@ -37,14 +37,16 @@ if (app.Environment.IsDevelopment()) app.UseSwaggerUI(); } DefaultFilesOptions defops = new DefaultFilesOptions(); -defops.DefaultFileNames.Clear(); + +//defops.DefaultFileNames.Clear(); defops.DefaultFileNames.Add("index.html"); app.UseDefaultFiles(defops); app.UseStaticFiles(); app.UseWebSockets(); app.UseAuthorization(); -app.Urls.Clear(); -app.Urls.Add("http://0.0.0.0:6818"); + +//app.Urls.Clear(); +//app.Urls.Add("http://0.0.0.0:6818"); app.MapControllers(); app.Run(); diff --git a/Server/RemoteServer/Program.cs b/Server/RemoteServer/Program.cs index 6c11bb7..35d4da4 100644 --- a/Server/RemoteServer/Program.cs +++ b/Server/RemoteServer/Program.cs @@ -40,7 +40,8 @@ if (app.Environment.IsDevelopment()) app.UseSwaggerUI(); } app.UseWebSockets(); -app.Urls.Clear(); -app.Urls.Add("http://0.0.0.0:6819"); + +//app.Urls.Clear(); +//app.Urls.Add("http://0.0.0.0:6819"); app.MapControllers(); app.Run();