mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-17 08:00:02 -04:00
fix: websocket prototype
This commit is contained in:
parent
51f1a773a4
commit
58fed66f78
5 changed files with 221 additions and 222 deletions
|
@ -21,7 +21,7 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
client.Proxy("WebSocket", {
|
||||
construct(ctx) {
|
||||
const fakeWebSocket = new EventTarget() as WebSocket;
|
||||
Object.setPrototypeOf(fakeWebSocket, self.WebSocket.prototype);
|
||||
Object.setPrototypeOf(fakeWebSocket, ctx.fn.prototype);
|
||||
fakeWebSocket.constructor = ctx.fn;
|
||||
|
||||
const trustEvent = (ev: Event) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue