更新依赖,增强ASR功能,优化代理路由处理,添加登录页面渲染
This commit is contained in:
@@ -7,6 +7,7 @@ import { getToken } from '@/module/http-token.ts';
|
||||
import { getTokenUserCache } from '@/routes/index.ts';
|
||||
import type { WebSocketListenerFun } from "@kevisual/router";
|
||||
import WebSocket from 'ws';
|
||||
import { renderNoAuthAndLogin } from '@/module/assistant/html/login.ts';
|
||||
const localProxy = new LocalProxy({});
|
||||
localProxy.initFromAssistantConfig(assistantConfig);
|
||||
|
||||
@@ -161,7 +162,8 @@ export const proxyRoute = async (req: http.IncomingMessage, res: http.ServerResp
|
||||
}
|
||||
const filter = await authFilter(req, res);
|
||||
if (filter) {
|
||||
return res.end('Not Authorized Proxy');
|
||||
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
||||
return res.end(renderNoAuthAndLogin('Not Authorized Proxy'));
|
||||
}
|
||||
const localProxyProxyList = localProxy.getLocalProxyList();
|
||||
const localProxyProxy = localProxyProxyList.find((item) => pathname.startsWith(item.path));
|
||||
|
||||
Reference in New Issue
Block a user