fix postmessage stuff a little more

This commit is contained in:
velzie 2024-09-19 20:04:32 -04:00
parent 4ae8dafccb
commit f48ecdb2b9
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
3 changed files with 86 additions and 82 deletions

View file

@ -3,6 +3,8 @@ import { encodeUrl } from "../../shared/rewriters/url";
import type { MessageC2W } from "../../worker";
import { ScramjetClient } from "../client";
const workerpostmessage = Worker.prototype.postMessage;
export default function (client: ScramjetClient, self: typeof globalThis) {
client.Proxy("Worker", {
construct({ args, call }) {
@ -36,7 +38,8 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
(async () => {
const port = await conn.getInnerPort();
worker.postMessage(
workerpostmessage.call(
worker,
{
$scramjet$type: "baremuxinit",
port,