mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
worker rewriting
This commit is contained in:
parent
2598bee87b
commit
f6c3c13d1e
22 changed files with 543 additions and 392 deletions
|
@ -1,20 +1,23 @@
|
|||
import { client } from "..";
|
||||
import { BareClient } from "../shared";
|
||||
const bare = new BareClient();
|
||||
|
||||
client.Proxy(window, "WebSocket", {
|
||||
construct(ctx) {
|
||||
ctx.return(
|
||||
bare.createWebSocket(
|
||||
ctx.args[0],
|
||||
ctx.args[1],
|
||||
ctx.fn as typeof WebSocket,
|
||||
{
|
||||
"User-Agent": navigator.userAgent,
|
||||
Origin: client.url.origin,
|
||||
},
|
||||
ArrayBuffer.prototype
|
||||
)
|
||||
);
|
||||
},
|
||||
});
|
||||
if ("window" in self) {
|
||||
const bare = new BareClient();
|
||||
|
||||
client.Proxy("WebSocket", {
|
||||
construct(ctx) {
|
||||
ctx.return(
|
||||
bare.createWebSocket(
|
||||
ctx.args[0],
|
||||
ctx.args[1],
|
||||
ctx.fn as typeof WebSocket,
|
||||
{
|
||||
"User-Agent": navigator.userAgent,
|
||||
Origin: client.url.origin,
|
||||
},
|
||||
ArrayBuffer.prototype
|
||||
)
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue