add nodejs support

This commit is contained in:
ading2210 2025-02-13 16:12:03 -05:00
parent 3a2ab40e75
commit 87b887a4b7
13 changed files with 78 additions and 18 deletions

View file

@ -3,10 +3,10 @@ ws ?= ?new WebSocketConstructor\(url, ?opts\)
*/
try {
if (api.transport === "wisp") {
ws = new WispWebSocket(url);
ws = new WispWebSocket(url, WSImpl);
}
else if (api.transport === "wsproxy") {
ws = new WebSocket(url);
ws = new WSImpl(url);
}
else if (typeof api.transport === "string") {
throw new TypeError("invalid transport type");