mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 23:30:00 -04:00
properly proxy worker postmessae
This commit is contained in:
parent
35eb307d4d
commit
4f5ae7b18a
4 changed files with 36 additions and 5 deletions
|
@ -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]
|
||||
);
|
||||
})();
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue