From b94501e82dd9e1fbd0815b7f8ce1b40cfae09331 Mon Sep 17 00:00:00 2001 From: raph-son Date: Tue, 12 Dec 2023 11:30:20 +0100 Subject: [PATCH] Fixed socket communication for windows --- src/mq.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mq.ts b/src/mq.ts index 86c2904..0b3501e 100644 --- a/src/mq.ts +++ b/src/mq.ts @@ -1,9 +1,16 @@ +import os from 'os'; + import zmq from "zeromq"; import { spawn } from "child_process"; const sock = zmq.socket("req"); -sock.connect("ipc:///tmp/humanify-local-inference-server.ipc"); +// Allow communication support for windows +if (os.platform() === 'win32') { + sock.connect("inproc:///tmp/humanify-local-inference-server.ipc"); +} else { + sock.connect("ipc:///tmp/humanify-local-inference-server.ipc"); +} export function send(message: Object) { sock.send(JSON.stringify(message));