From f50842fd7a444b9ab59f814464ae0e2e9ac8dfb2 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Thu, 28 Sep 2023 03:08:50 +0300 Subject: [PATCH] Socket-passthrough --- src/Socket/socket.ts | 2 +- src/Types/Socket.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Socket/socket.ts b/src/Socket/socket.ts index 7dcd409..e08b045 100644 --- a/src/Socket/socket.ts +++ b/src/Socket/socket.ts @@ -76,7 +76,7 @@ export const makeSocket = (config: SocketConfig) => { url = new URL(`tcp://${MOBILE_ENDPOINT}:${MOBILE_PORT}`) } - const ws = config.mobile ? new MobileSocketClient(url, config) : new WebSocketClient(url, config) + const ws = config.socket ? config.socket : config.mobile ? new MobileSocketClient(url, config) : new WebSocketClient(url, config) ws.connect() diff --git a/src/Types/Socket.ts b/src/Types/Socket.ts index 51dd6f7..5d05e92 100644 --- a/src/Types/Socket.ts +++ b/src/Types/Socket.ts @@ -115,4 +115,6 @@ export type SocketConfig = { getMessage: (key: proto.IMessageKey) => Promise makeSignalRepository: (auth: SignalAuthState) => SignalRepository + + socket: any }