@@ -174,7 +174,7 @@ export abstract class Browser extends SdkObject {
174174 return video ?. artifact ;
175175 }
176176
177- async startServer ( title : string , options : { workspaceDir ?: string , wsPath ?: string , pipeName ?: string } ) : Promise < { wsEndpoint ?: string , pipeName ?: string } > {
177+ async startServer ( title : string , options : channels . BrowserStartServerOptions ) : Promise < { wsEndpoint ?: string , pipeName ?: string } > {
178178 return await this . _server . start ( title , options ) ;
179179 }
180180
@@ -219,7 +219,7 @@ export class BrowserServer {
219219 this . _browser = browser ;
220220 }
221221
222- async start ( title : string , options : { workspaceDir ?: string , wsPath ?: string } ) : Promise < { wsEndpoint ?: string , pipeName ?: string } > {
222+ async start ( title : string , options : channels . BrowserStartServerOptions ) : Promise < { wsEndpoint ?: string , pipeName ?: string } > {
223223 if ( this . _isStarted )
224224 throw new Error ( `Server is already started.` ) ;
225225 this . _isStarted = true ;
@@ -233,7 +233,7 @@ export class BrowserServer {
233233 if ( options . wsPath ) {
234234 const path = options . wsPath . startsWith ( '/' ) ? options . wsPath : `/${ options . wsPath } ` ;
235235 this . _wsServer = new PlaywrightWebSocketServer ( this . _browser , path ) ;
236- result . wsEndpoint = await this . _wsServer . listen ( 0 , 'localhost' , path ) ;
236+ result . wsEndpoint = await this . _wsServer . listen ( options . port ?? 0 , options . host ?? 'localhost' , path ) ;
237237 }
238238
239239 const browserInfo : BrowserInfo = {
@@ -247,6 +247,7 @@ export class BrowserServer {
247247 wsEndpoint : result . wsEndpoint ,
248248 pipeName : result . pipeName ,
249249 workspaceDir : options . workspaceDir ,
250+ metadata : options . metadata ,
250251 } ) ;
251252 return result ;
252253 }
0 commit comments