File tree Expand file tree Collapse file tree
shared/packages/expectationManager/src/internalManager/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,15 +100,27 @@ export class ExpectationManagerServer {
100100 } else if ( this . serverAccessBaseUrls ) {
101101 this . _serverAccessUrls = this . serverAccessBaseUrls
102102 } else {
103- let url = 'ws://127.0.0.1'
104- if ( this . serverOptions . type === 'websocket' && this . serverOptions . port === 0 ) {
105- // When the configured port i 0, the next free port is picked
106- url += `:${ this . manager . expectationManagerServer . websocketServer ?. port } `
107- }
108103 this . _serverAccessUrls = {
109- '*' : url ,
104+ '*' : 'ws://127.0.0.1' ,
105+ }
106+ }
107+ this . logger . info ( `##### type: ${ this . workForceConnectionOptions . type } ` )
108+ if ( this . serverOptions . type === 'websocket' && this . serverOptions . port === 0 ) {
109+ this . logger . info ( `##### this.serverOptions.port: ${ this . serverOptions . port } ` )
110+ // When the configured port i 0, the next free port is picked
111+ for ( const key of Object . keys ( this . _serverAccessUrls ) ) {
112+ // If no port was specified in the url, add it:
113+ if ( ! this . _serverAccessUrls [ key ] . match ( / \/ \/ [ ^ / ] + : \d / ) ) {
114+ this . logger . info ( `updateing ${ key } ` )
115+ this . _serverAccessUrls [ key ] += `:${ this . manager . expectationManagerServer . websocketServer ?. port } `
116+ }
110117 }
111118 }
119+
120+ this . logger . info ( `##### this.serverAccessBaseUrls: ${ JSON . stringify ( this . serverAccessBaseUrls ) } ` )
121+ this . logger . info ( `##### websocketServer?.port: ${ this . manager . expectationManagerServer . websocketServer ?. port } ` )
122+ this . logger . info ( `##### this._serverAccessUrls: ${ JSON . stringify ( this . _serverAccessUrls ) } ` )
123+
112124 if ( ! this . _serverAccessUrls ) throw new Error ( `ExpectationManager.serverAccessUrl not set!` )
113125 }
114126 terminate ( ) : void {
You can’t perform that action at this time.
0 commit comments