fix tests

This commit is contained in:
2025-05-13 21:28:02 +00:00
parent fcc8cf9caa
commit 0fe0692e43
3 changed files with 37 additions and 15 deletions

View File

@ -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;
}