Commit cf12428d authored by nanahira's avatar nanahira

don't proxy ws

parent 63c1029a
Pipeline #6150 passed with stages
in 36 seconds
{
"name": "koishi-nestjs",
"version": "1.0.28",
"version": "1.0.29",
"description": "Koishi.js as Nest.js Module",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
......
......@@ -13,18 +13,14 @@ export class KoishiMiddleware
async onModuleInit() {
this.proxyMiddleware = createProxyMiddleware({
target: `http://localhost:${this.koishi._nestKoaTmpServerPort}`,
ws: true,
ws: false,
logLevel: 'silent',
});
}
use(req: Request, res: Response, next: NextFunction) {
const match = this.koishi.router.match(req.baseUrl, req.method);
if (
!match.route &&
// ws-reverse onebot goes here
!req.header('x-self-id')
) {
if (!match.route) {
return next();
}
return this.proxyMiddleware(req, res, next);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment