Merge pull request #12761 from PieterScheffers/tcp-use-random-port

Be able to use a random port for the TCP server
This commit is contained in:
Kamil Mysliwiec
2024-11-06 13:22:30 +01:00
committed by GitHub

View File

@@ -43,10 +43,10 @@ export class ServerTCP extends Server implements CustomTransportStrategy {
constructor(private readonly options: TcpOptions['options']) {
super();
this.port = this.getOptionsProp(options, 'port') || TCP_DEFAULT_PORT;
this.host = this.getOptionsProp(options, 'host') || TCP_DEFAULT_HOST;
this.port = this.getOptionsProp(options, 'port', TCP_DEFAULT_PORT);
this.host = this.getOptionsProp(options, 'host', TCP_DEFAULT_HOST);
this.socketClass =
this.getOptionsProp(options, 'socketClass') || JsonSocket;
this.getOptionsProp(options, 'socketClass', JsonSocket);
this.tlsOptions = this.getOptionsProp(options, 'tlsOptions');
this.init();