mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 14:30:02 -04:00
refactor: everything
This commit is contained in:
parent
78e666d314
commit
506d99f9b6
37 changed files with 925 additions and 885 deletions
23
src/client/shared/requests/websocket.ts
Normal file
23
src/client/shared/requests/websocket.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { ScramjetClient } from "../../client";
|
||||
import { BareClient } from "../../shared";
|
||||
|
||||
export default function (client: ScramjetClient, self: typeof globalThis) {
|
||||
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": self.navigator.userAgent,
|
||||
Origin: client.url.origin,
|
||||
},
|
||||
ArrayBuffer.prototype
|
||||
)
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue