properly proxy worker postmessae

This commit is contained in:
velzie 2024-09-02 16:21:48 -04:00
parent 35eb307d4d
commit 4f5ae7b18a
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
4 changed files with 36 additions and 5 deletions

View file

@ -33,9 +33,16 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
const worker = call();
const conn = new BareMuxConnection();
(async () => {
const port = await conn.getInnerPort();
worker.postMessage(port, [port]);
worker.postMessage(
{
$scramjet$type: "baremuxinit",
port,
},
[port]
);
})();
},
});