From 4f942eab03353f0026c37dcbb29be3ba0742c9aa Mon Sep 17 00:00:00 2001 From: springhgui <740360381@qq.com> Date: Tue, 15 Dec 2020 11:20:05 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=E3=80=91parse=20host?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastTunnel.Client/appsettings.json | 2 +- FastTunnel.Core/Dispatchers/HttpDispatcher.cs | 2 +- FastTunnel.Server/FastTunnel.Server.csproj | 8 ++++---- FastTunnel.Server/Program.cs | 2 +- FastTunnel.Server/Startup.cs | 1 - 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/FastTunnel.Client/appsettings.json b/FastTunnel.Client/appsettings.json index aaab27d..546fa66 100644 --- a/FastTunnel.Client/appsettings.json +++ b/FastTunnel.Client/appsettings.json @@ -21,7 +21,7 @@ "LocalIp": "127.0.0.1", // 站点监听的端口号 - "LocalPort": 8080, + "LocalPort": 3389, // 子域名, 访问本站点时的url为 http://{SubDomain}.{Domain}:{ProxyPort_HTTP}/ "SubDomain": "test", // test.test.cc diff --git a/FastTunnel.Core/Dispatchers/HttpDispatcher.cs b/FastTunnel.Core/Dispatchers/HttpDispatcher.cs index 556b5a5..5277558 100644 --- a/FastTunnel.Core/Dispatchers/HttpDispatcher.cs +++ b/FastTunnel.Core/Dispatchers/HttpDispatcher.cs @@ -84,7 +84,7 @@ namespace FastTunnel.Core.Dispatchers words = Encoding.UTF8.GetString(array, 0, (int)tempBuffer.Length); collection = Regex.Matches(words, pattern); - if (collection.Count > 0) + if (collection.Count > 0 || count < buffer.Length) { break; } diff --git a/FastTunnel.Server/FastTunnel.Server.csproj b/FastTunnel.Server/FastTunnel.Server.csproj index 7a868d3..70e0426 100644 --- a/FastTunnel.Server/FastTunnel.Server.csproj +++ b/FastTunnel.Server/FastTunnel.Server.csproj @@ -1,4 +1,4 @@ - + net5.0 @@ -17,9 +17,9 @@ - - - + + + diff --git a/FastTunnel.Server/Program.cs b/FastTunnel.Server/Program.cs index 76c0200..80eb95d 100644 --- a/FastTunnel.Server/Program.cs +++ b/FastTunnel.Server/Program.cs @@ -13,7 +13,7 @@ namespace FastTunnel.Server { public static void Main(string[] args) { - var logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); + var logger = NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); try { CreateHostBuilder(args).Build().Run(); diff --git a/FastTunnel.Server/Startup.cs b/FastTunnel.Server/Startup.cs index 0c187a2..3ececa7 100644 --- a/FastTunnel.Server/Startup.cs +++ b/FastTunnel.Server/Startup.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; namespace FastTunnel.Server {