added port warnings

This commit is contained in:
Jonathan Barrow 2024-02-25 11:31:17 -05:00
parent a3391e5190
commit e11448be88
No known key found for this signature in database
GPG Key ID: E86E9FE9049C741F

View File

@ -60,6 +60,19 @@ if (udpPort === 0 && tcpPort === 0) {
process.exit();
}
if (udpPort === tcpPort) {
console.log(colors.bgRed('UDP and TCP ports cannot match'));
process.exit();
}
if (udpPort === 0) {
console.log(colors.bgYellow('UDP port not set. One will be randomly assigned'));
}
if (tcpPort === 0) {
console.log(colors.bgYellow('TCP port not set. One will be randomly assigned'));
}
const server = createServer({
udp: true,
tcp: true,