portprism 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -72810,11 +72810,12 @@ var Agent = class extends EventEmitter4 {
|
|
|
72810
72810
|
});
|
|
72811
72811
|
localWs.on("message", (data, isBinary) => {
|
|
72812
72812
|
if (this.ws?.readyState !== import_ws2.default.OPEN) return;
|
|
72813
|
+
const binary = typeof isBinary === "boolean" ? isBinary : Buffer.isBuffer(data);
|
|
72813
72814
|
this.ws.send(JSON.stringify({
|
|
72814
72815
|
type: "ws-message",
|
|
72815
72816
|
wsId,
|
|
72816
|
-
data:
|
|
72817
|
-
binary
|
|
72817
|
+
data: binary ? Buffer.from(data).toString("base64") : data.toString(),
|
|
72818
|
+
binary
|
|
72818
72819
|
}));
|
|
72819
72820
|
});
|
|
72820
72821
|
localWs.on("close", (code, reason) => {
|