diff --git a/packages/core/server/src/gateway/index.ts b/packages/core/server/src/gateway/index.ts index 77cba5212c..2d6a5ab3f2 100644 --- a/packages/core/server/src/gateway/index.ts +++ b/packages/core/server/src/gateway/index.ts @@ -13,7 +13,6 @@ import { resolve } from 'path'; import qs from 'qs'; import handler from 'serve-handler'; import { parse } from 'url'; -import xpipe from 'xpipe'; import { AppSupervisor } from '../app-supervisor'; import { ApplicationOptions } from '../application'; import { getPackageDirByExposeUrl, getPackageNameByExposeUrl, PLUGIN_STATICS_PATH } from '../plugin-manager'; @@ -59,7 +58,7 @@ export class Gateway extends EventEmitter { private port: number = process.env.APP_PORT ? parseInt(process.env.APP_PORT) : null; private host = '0.0.0.0'; private wsServer: WSServer; - private socketPath = xpipe.eq(resolve(process.cwd(), 'storage', 'gateway.sock')); + private socketPath = resolve(process.cwd(), 'storage', 'gateway.sock'); loggers = new Registry(); @@ -67,7 +66,7 @@ export class Gateway extends EventEmitter { super(); this.reset(); if (process.env.SOCKET_PATH) { - this.socketPath = xpipe.eq(resolve(process.cwd(), process.env.SOCKET_PATH)); + this.socketPath = resolve(process.cwd(), process.env.SOCKET_PATH); } } diff --git a/packages/core/server/src/gateway/ipc-socket-client.ts b/packages/core/server/src/gateway/ipc-socket-client.ts index 970c9c9816..a6605f4b5e 100644 --- a/packages/core/server/src/gateway/ipc-socket-client.ts +++ b/packages/core/server/src/gateway/ipc-socket-client.ts @@ -1,5 +1,6 @@ import net from 'net'; import * as events from 'events'; +import xpipe from 'xpipe'; import { Logger, createConsoleLogger } from '@nocobase/logger'; export const writeJSON = (socket: net.Socket, data: object) => { @@ -34,7 +35,7 @@ export class IPCSocketClient extends events.EventEmitter { static async getConnection(serverPath: string) { return new Promise((resolve, reject) => { - const client = net.createConnection({ path: serverPath }, () => { + const client = net.createConnection({ path: xpipe.eq(serverPath) }, () => { // 'connect' listener. resolve(new IPCSocketClient(client)); }); diff --git a/packages/core/server/src/gateway/ipc-socket-server.ts b/packages/core/server/src/gateway/ipc-socket-server.ts index 04d0dc21e5..7677e0ad5d 100644 --- a/packages/core/server/src/gateway/ipc-socket-server.ts +++ b/packages/core/server/src/gateway/ipc-socket-server.ts @@ -1,6 +1,7 @@ import net from 'net'; import fs from 'fs'; import path from 'path'; +import xpipe from 'xpipe'; import { AppSupervisor } from '../app-supervisor'; import { writeJSON } from './ipc-socket-client'; import { randomUUID } from 'crypto'; @@ -64,7 +65,7 @@ export class IPCSocketServer { }); }); - socketServer.listen(socketPath, () => { + socketServer.listen(xpipe.eq(socketPath), () => { console.log(`Gateway IPC Server running at ${socketPath}`); });