From 2ffe3c4373631cb762410e0a253f7e746eca0274 Mon Sep 17 00:00:00 2001 From: ZhaoLei Date: Fri, 1 Nov 2024 16:20:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BD=93=E4=BC=A0=E9=80=92=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E8=BF=87=E5=A4=A7=E6=97=B6=E7=9A=84=EF=BC=8Cwebsocket?= =?UTF-8?q?=20=E6=8E=A5=E6=94=B6=E6=B6=88=E6=81=AF=E7=9A=84=E4=B8=8D?= =?UTF-8?q?=E8=B6=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/Common/ConnectPipeline.cs | 4 ++-- Server/RemoteServer/Program.cs | 4 ++-- Server/RemoteServer/appsettings.json | 3 ++- Tool/webtool/src/connect.js | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Server/Common/ConnectPipeline.cs b/Server/Common/ConnectPipeline.cs index 22cbc12..65b6a5c 100644 --- a/Server/Common/ConnectPipeline.cs +++ b/Server/Common/ConnectPipeline.cs @@ -103,8 +103,8 @@ public class WebSocPipeLine(TSocket socket, bool isAES) : AbsPipeLine(i protected override async Task Listen(Func receiveCb) { - //warning 最大支持1MB,这由需要同步的文件数量大小决定 UTF-8 每个字符,汉字视为4个字节,数字1个 ,英文字母2个。1MB=256KB*4,25万个字符能描述就行 - var buffer = new byte[1024 * 1024]; + //warning 最大支持10MB,这由需要同步的文件数量大小决定 UTF-8 每个字符,汉字视为4个字节,数字1个 ,英文字母2个。1MB=256KB*4,25万个字符能描述就行 + var buffer = new byte[10 * 1024 * 1024]; while (Socket.State == WebSocketState.Open) { diff --git a/Server/RemoteServer/Program.cs b/Server/RemoteServer/Program.cs index 35d4da4..ae8811f 100644 --- a/Server/RemoteServer/Program.cs +++ b/Server/RemoteServer/Program.cs @@ -41,7 +41,7 @@ if (app.Environment.IsDevelopment()) } 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(); diff --git a/Server/RemoteServer/appsettings.json b/Server/RemoteServer/appsettings.json index 40f7a82..55ba9e7 100644 --- a/Server/RemoteServer/appsettings.json +++ b/Server/RemoteServer/appsettings.json @@ -11,7 +11,8 @@ "AllowedHosts": "*", "TempDir": "D:\\FileSyncTest\\dtemp", "NamePwds": [ - [ "Test", "t123" ] + [ "Test", "t123" ], + [ "FYMF", "FYMF" ] ], "SqlPackageAbPath": "C:\\Users\\ZHAOLEI\\.dotnet\\tools\\sqlpackage.exe" } diff --git a/Tool/webtool/src/connect.js b/Tool/webtool/src/connect.js index e9f5cbd..a61d682 100644 --- a/Tool/webtool/src/connect.js +++ b/Tool/webtool/src/connect.js @@ -6,8 +6,8 @@ class ConnectPipe { // this.#websocket = new WebSocket(`ws://${window.location.host}`) } OpenPipe(config, MsgCb) { - // var webSocUrl = `ws://${window.location.host}/websoc?Name=${config.Name}` - var webSocUrl = "ws://127.0.0.1:6818/websoc?Name=Test"; + var webSocUrl = `ws://${window.location.host}/websoc?Name=${config.Name}` + // var webSocUrl = "ws://127.0.0.1:6818/websoc?Name=Test"; this.#websocket = new WebSocket(webSocUrl); this.#websocket.onopen = (event) => { var starter = {