mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
clean up websocket proxy
This commit is contained in:
parent
738198f954
commit
bc9c7310ea
1 changed files with 2 additions and 3 deletions
|
@ -1,12 +1,11 @@
|
||||||
import { BareClient } from "@mercuryworkshop/bare-mux"
|
import { BareClient } from "@mercuryworkshop/bare-mux"
|
||||||
const client = new BareClient()
|
const client = new BareClient()
|
||||||
const RealWebSocket = WebSocket
|
|
||||||
WebSocket = new Proxy(WebSocket, {
|
WebSocket = new Proxy(WebSocket, {
|
||||||
construct(_target, args) {
|
construct(target, args) {
|
||||||
return client.createWebSocket(
|
return client.createWebSocket(
|
||||||
args[0],
|
args[0],
|
||||||
args[1],
|
args[1],
|
||||||
RealWebSocket,
|
target,
|
||||||
{
|
{
|
||||||
"User-Agent": navigator.userAgent
|
"User-Agent": navigator.userAgent
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue