From 4cbc932dda92c008713217643e699762762c9c47 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Tue, 1 Aug 2023 22:34:04 +0800 Subject: [PATCH] feat: support uds --- src/client/Client.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/Client.ts b/src/client/Client.ts index 55f832f..99c2ceb 100644 --- a/src/client/Client.ts +++ b/src/client/Client.ts @@ -62,7 +62,11 @@ export default class Client { this.host = host; this.port = port; const clientCredentials = ChannelCredentials.createInsecure(); - const address = `${this.host}:${this.port}`; + let address = `${this.host}:${this.port}`; + // Support UDS + if (this.host.startsWith('unix://')) { + address = this.host; + } this._runtime = new RuntimeClient(address, clientCredentials); debug('Start connection to %o', address); if (options?.ossEnable || options?.oss) {