mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
Merge branch 'main' of https://github.com/MercuryWorkshop/scramjet
This commit is contained in:
commit
baccc82ab7
4 changed files with 19 additions and 2 deletions
|
@ -3,8 +3,9 @@ import "./trustedTypes.ts";
|
|||
import "./eval.ts";
|
||||
import "./storage";
|
||||
import "./element.ts";
|
||||
import "./fetch.ts";
|
||||
import "./xmlhttprequest.ts";
|
||||
import "./requests/fetch.ts";
|
||||
import "./requests/xmlhttprequest.ts";
|
||||
import "./requests/websocket.ts"
|
||||
import "./css.ts";
|
||||
|
||||
declare global {
|
||||
|
|
16
src/client/requests/websocket.ts
Normal file
16
src/client/requests/websocket.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { BareClient } from "@mercuryworkshop/bare-mux"
|
||||
const client = new BareClient()
|
||||
const RealWebSocket = WebSocket
|
||||
WebSocket = new Proxy(WebSocket, {
|
||||
construct(_target, args) {
|
||||
return client.createWebSocket(
|
||||
args[0],
|
||||
args[1],
|
||||
RealWebSocket,
|
||||
{
|
||||
"User-Agent": navigator.userAgent
|
||||
},
|
||||
ArrayBuffer.prototype
|
||||
)
|
||||
}
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue