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";
7
7
import type { Request , Response } from "../protocol.js" ;
8
8
import type { ResilientWebSocketConfig } from "./resilient-websocket.js" ;
9
9
import { ResilientWebSocket } from "./resilient-websocket.js" ;
10
+ import type { ClientRequestArgs } from "node:http" ;
10
11
11
12
/**
12
13
* Detects if the code is running in a regular DOM or Web Worker context.
@@ -49,7 +50,7 @@ function isBrowser(): boolean {
49
50
function addAuthentication (
50
51
url : string ,
51
52
token : string ,
52
- wsOptions : any = { }
53
+ wsOptions : WebSocket . ClientOptions | ClientRequestArgs | undefined = { }
53
54
) : { endpoint : string ; wsOptions : any } {
54
55
if ( isBrowser ( ) ) {
55
56
// Browser: Add token as query parameter
@@ -58,7 +59,7 @@ function addAuthentication(
58
59
59
60
// For browsers, we need to filter out any options that aren't valid for WebSocket constructor
60
61
// 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 ;
62
63
63
64
return {
64
65
endpoint : urlObj . toString ( ) ,
You can’t perform that action at this time.
0 commit comments