File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { dummyLogger } from "ts-log";
77import type { Request , Response } from "../protocol.js" ;
88import type { ResilientWebSocketConfig } from "./resilient-websocket.js" ;
99import { ResilientWebSocket } from "./resilient-websocket.js" ;
10+ import type { ClientRequestArgs } from "node:http" ;
1011
1112/**
1213 * Detects if the code is running in a regular DOM or Web Worker context.
@@ -49,7 +50,7 @@ function isBrowser(): boolean {
4950function addAuthentication (
5051 url : string ,
5152 token : string ,
52- wsOptions : any = { }
53+ wsOptions : WebSocket . ClientOptions | ClientRequestArgs | undefined = { }
5354) : { endpoint : string ; wsOptions : any } {
5455 if ( isBrowser ( ) ) {
5556 // Browser: Add token as query parameter
@@ -58,7 +59,7 @@ function addAuthentication(
5859
5960 // For browsers, we need to filter out any options that aren't valid for WebSocket constructor
6061 // Browser WebSocket constructor only accepts protocols as second parameter
61- const browserWsOptions = wsOptions . protocols ? wsOptions . protocols : undefined ;
62+ const browserWsOptions = wsOptions . protocol ? wsOptions . protocol : undefined ;
6263
6364 return {
6465 endpoint : urlObj . toString ( ) ,
You can’t perform that action at this time.
0 commit comments