fix tests
This commit is contained in:
@ -160,6 +160,14 @@ export class NetworkProxy implements IMetricsTracker {
|
||||
* Useful for SmartProxy to determine where to forward connections
|
||||
*/
|
||||
public getListeningPort(): number {
|
||||
// If the server is running, get the actual listening port
|
||||
if (this.httpsServer && this.httpsServer.address()) {
|
||||
const address = this.httpsServer.address();
|
||||
if (address && typeof address === 'object' && 'port' in address) {
|
||||
return address.port;
|
||||
}
|
||||
}
|
||||
// Fallback to configured port
|
||||
return this.options.port;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user