add custom network transport support

This commit is contained in:
ading2210 2024-03-07 12:34:20 -05:00
parent 53a474430a
commit be3fc7286c
3 changed files with 23 additions and 1 deletions

View file

@ -1,4 +1,14 @@
/* REPLACE
new WebSocketConstructor
*/
new WispWebSocket
new ((() => {
if (api.transport === "wisp") {
return WispWebSocket;
}
else if (api.transport === "wsproxy") {
return WebSocket;
}
else { //custom transports
return api.transport;
}
})())

View file

@ -244,6 +244,7 @@ api = {
wisp_connections: _wisp_connections,
WispConnection: WispConnection,
transport: "wisp",
get copyright() {return copyright_notice},
get version() {return get_version()},