mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
workspace: add experimental pnpm support
This commit is contained in:
1 parent
6c4bd6c21d
commit
188a8c6ed0
12 files changed
+71
-20
No files matched your search
@@ -1,4 +1,9 @@
|
||||
import serialize from 'serialize-javascript';
|
||||
import db from './service/db';
|
||||
|
||||
export { nanoid } from 'nanoid';
|
||||
export { serialize };
|
||||
|
||||
export * from './pipelineUtils';
|
||||
export * from './error';
|
||||
export * from './libs';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { IncomingMessage } from 'http';
|
||||
import KoaRouter from 'koa-router';
|
||||
import parseUrl from 'parseurl';
|
||||
import { pathToRegexp } from 'path-to-regexp';
|
||||
import type WebSocket from 'ws';
|
||||
import type { KoaContext } from './server';
|
||||
@@ -20,7 +19,7 @@ export class WebSocketLayer {
|
||||
}
|
||||
|
||||
accept(socket: WebSocket, request: IncomingMessage, ctx: KoaContext) {
|
||||
if (!this.regexp.test(parseUrl(request).pathname)) return false;
|
||||
if (!this.regexp.test(new URL(request.url, `http://${request.headers.host}`).pathname)) return false;
|
||||
this.clients.add(socket);
|
||||
socket.on('close', () => {
|
||||
this.clients.delete(socket);
|
||||
|
||||
Reference in new issue
Block a user