mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
23 lines
425 B
TypeScript
23 lines
425 B
TypeScript
import { client } from "..";
|
|
import { BareClient } from "../shared";
|
|
|
|
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
|
|
)
|
|
);
|
|
},
|
|
});
|
|
}
|