refactor: migrate WebSocket proxy to v1-ws-proxy module

- Updated import paths to use the new v1-ws-proxy module.
- Removed the old ws-proxy module and its associated files.
- Implemented new WebSocket proxy logic in the v1-ws-proxy module.
- Adjusted UserV1Proxy to utilize the new WebSocket proxy manager and methods.
This commit is contained in:
2026-02-20 21:55:48 +08:00
parent 0d73941127
commit 1782a9ef19
7 changed files with 189 additions and 184 deletions

View File

@@ -2,7 +2,7 @@ import { app } from './app.ts';
import './route.ts';
import { handleRequest } from './routes-simple/index.ts';
import { port } from './modules/config.ts';
import { wssFun } from './modules/ws-proxy/index.ts';
import { wssFun } from './modules/v1-ws-proxy/index.ts';
import { WebSocketListenerFun, HttpListenerFun } from '@kevisual/router/src/server/server-type.js';
console.log('Starting server...', port);
app.listen(port, '0.0.0.0', () => {

View File

@@ -2,7 +2,6 @@ import { nanoid } from 'nanoid';
import { WebSocket } from 'ws';
import { logger } from '../logger.ts';
import { EventEmitter } from 'eventemitter3';
import { set } from 'zod';
class WsMessage {
ws: WebSocket;

View File

@@ -12,7 +12,7 @@ import { UserPermission } from '@kevisual/permission';
import { getLoginUser } from '../modules/auth.ts';
import { rediretHome } from '../modules/user-app/index.ts';
import { logger } from '../modules/logger.ts';
import { UserV1Proxy } from '../modules/ws-proxy/proxy.ts';
import { UserV1Proxy } from '../modules/v1-ws-proxy/proxy.ts';
import { UserV3Proxy } from '@/modules/v3/index.ts';
import { hasBadUser, userIsBanned, appIsBanned, userPathIsBanned } from '@/modules/off/index.ts';
import { robotsTxt } from '@/modules/html/index.ts';