Skip to content

Commit dd240ab

Browse files
committed
fix(webdriver): ability to send options to connect via ws
1 parent c3f9a76 commit dd240ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/webdriver/src/node/bidi.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import WebSocket from 'ws'
99
const log = logger('webdriver')
1010
const CONNECTION_TIMEOUT = 10000
1111

12-
export async function createBidiConnection(webSocketUrl: string, options?: unknown): Promise<WebSocket | undefined> {
12+
export async function createBidiConnection(webSocketUrl: string, options?: WebSocket.ClientOptions): Promise<WebSocket | undefined> {
1313
const candidateUrls = await listWebsocketCandidateUrls(webSocketUrl)
1414
return connectWebsocket(candidateUrls, options)
1515
}
@@ -54,11 +54,11 @@ interface ConnectionPromise {
5454
* @param candidateUrls - list of websocket urls to try
5555
* @returns true if the connection was successful
5656
*/
57-
export async function connectWebsocket(candidateUrls: string[], _?: unknown): Promise<WebSocket | undefined> {
57+
export async function connectWebsocket(candidateUrls: string[], options?: WebSocket.ClientOptions): Promise<WebSocket | undefined> {
5858
const websockets: WebSocket[] = candidateUrls.map((candidateUrl) => {
5959
log.debug(`Attempt to connect to webSocketUrl ${candidateUrl}`)
6060
try {
61-
const ws = new WebSocket(candidateUrl)
61+
const ws = new WebSocket(candidateUrl, options)
6262
return ws
6363
} catch {
6464
return undefined

0 commit comments

Comments
 (0)