From 0c467fdfbb7f9a094306412bb32b45af6570118b Mon Sep 17 00:00:00 2001 From: HynoR <20227709+HynoR@users.noreply.github.com> Date: Thu, 27 Nov 2025 01:11:07 +0800 Subject: [PATCH] fix: adjust WebSocket buffer sizes in terminal and host API --- agent/app/api/v2/terminal.go | 4 ++-- core/app/api/v2/host.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/agent/app/api/v2/terminal.go b/agent/app/api/v2/terminal.go index 61372620349a..16685edac1c3 100644 --- a/agent/app/api/v2/terminal.go +++ b/agent/app/api/v2/terminal.go @@ -228,8 +228,8 @@ func wshandleError(ws *websocket.Conn, err error) bool { } var upGrader = websocket.Upgrader{ - ReadBufferSize: 1024, - WriteBufferSize: 1024 * 1024 * 10, + ReadBufferSize: 4096, + WriteBufferSize: 16384, CheckOrigin: func(r *http.Request) bool { return true }, diff --git a/core/app/api/v2/host.go b/core/app/api/v2/host.go index 33312855d4d1..621f6d0df7ec 100644 --- a/core/app/api/v2/host.go +++ b/core/app/api/v2/host.go @@ -327,8 +327,8 @@ func (b *BaseApi) WsSsh(c *gin.Context) { } var upGrader = websocket.Upgrader{ - ReadBufferSize: 1024, - WriteBufferSize: 1024 * 1024 * 10, + ReadBufferSize: 4096, + WriteBufferSize: 16384, CheckOrigin: func(r *http.Request) bool { return true },