@replit/river
Advanced tools
Comparing version
@@ -43,3 +43,5 @@ import WebSocket from 'isomorphic-ws'; | ||
export async function createLocalWebSocketClient(port) { | ||
return new WebSocket(`ws://localhost:${port}`); | ||
const sock = new WebSocket(`ws://localhost:${port}`); | ||
sock.binaryType = 'arraybuffer'; | ||
return sock; | ||
} | ||
@@ -62,2 +64,3 @@ /** | ||
wss.removeListener('connection', onConnect); | ||
serverSock.binaryType = 'arraybuffer'; | ||
resolve(serverSock); | ||
@@ -64,0 +67,0 @@ }); |
@@ -46,3 +46,3 @@ import { Value } from '@sinclair/typebox/value'; | ||
if (parsedMsg === null) { | ||
log?.warn(`${this.clientId} -- received malformed msg: ${msg}`); | ||
log?.warn(`${this.clientId} -- received malformed msg: ${msg.toString()}`); | ||
return; | ||
@@ -53,3 +53,3 @@ } | ||
// process ack | ||
log?.info(`${this.clientId} -- received ack: ${msg}`); | ||
log?.info(`${this.clientId} -- received ack: ${msg.toString()}`); | ||
if (this.sendBuffer.has(parsedMsg.payload.ack)) { | ||
@@ -61,3 +61,3 @@ this.sendBuffer.delete(parsedMsg.payload.ack); | ||
// regular river message | ||
log?.info(`${this.clientId} -- received msg: ${msg}`); | ||
log?.info(`${this.clientId} -- received msg: ${msg.toString()}`); | ||
// ignore if not for us | ||
@@ -77,3 +77,3 @@ if (parsedMsg.to !== this.clientId && parsedMsg.to !== 'broadcast') { | ||
else { | ||
log?.warn(`${this.clientId} -- received invalid transport msg: ${msg}`); | ||
log?.warn(`${this.clientId} -- received invalid transport msg: ${msg.toString()}`); | ||
} | ||
@@ -80,0 +80,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "It's like tRPC but... with JSON Schema Support, duplex streaming and support for service multiplexing. Transport agnostic!", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
203849
0.08%4441
0.07%