update
This commit is contained in:
@@ -6,6 +6,7 @@ import { initializeUpgradeHandler } from './websocket/upgrade';
|
||||
import { initializeConnectionHandler } from './websocket/connection';
|
||||
import { clientStates } from './websocket/state';
|
||||
import { sshSuspendService } from './services/ssh-suspend.service'; // 导入实例
|
||||
import { SftpService } from './services/sftp.service'; // +++ 导入 SftpService +++
|
||||
// TemporaryLogStorageService 是 SshSuspendService 的依赖,SshSuspendService 内部会处理它的实例化或导入,
|
||||
// websocket.ts 层面不需要直接使用 temporaryLogStorageService。
|
||||
// 如果 SshSuspendService 的构造函数需要一个 TemporaryLogStorageService 实例,
|
||||
@@ -43,8 +44,11 @@ export const initializeWebSocket = async (server: http.Server, sessionParser: Re
|
||||
// 2. Initialize Upgrade Handler (handles authentication and protocol upgrade)
|
||||
initializeUpgradeHandler(server, wss, sessionParser);
|
||||
|
||||
// +++ 创建 SftpService 实例 +++
|
||||
const sftpService = new SftpService(clientStates);
|
||||
|
||||
// 3. Initialize Connection Handler (handles 'connection' event and message routing)
|
||||
initializeConnectionHandler(wss, sshSuspendService); // 传递 sshSuspendService 实例
|
||||
initializeConnectionHandler(wss, sshSuspendService, sftpService); // +++ 传递 sftpService 实例 +++
|
||||
|
||||
// --- WebSocket 服务器关闭处理 ---
|
||||
wss.on('close', () => {
|
||||
|
||||
Reference in New Issue
Block a user