Right now the port generation is using Math.random and Math.floor. It would be better to use crypto.randomInt. crypto.randomInt was introduced to Node in v12.19.0 and v14.10.0 and as we support Node 16.6.0 and newer this will have no breaking effect.