From c8e054ce25ffc0a34b0fe9553d32c81498adf0b6 Mon Sep 17 00:00:00 2001 From: Moe Date: Thu, 4 Jun 2020 12:59:46 -0700 Subject: [PATCH] validate port chosen on monitor start --- libs/monitor.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libs/monitor.js b/libs/monitor.js index d4b76eb1..de281ce3 100644 --- a/libs/monitor.js +++ b/libs/monitor.js @@ -1526,7 +1526,11 @@ module.exports = function(s,config,lang){ e.type !== 'local' && e.details.skip_ping !== '1' ){ - connectionTester.test(strippedHost,e.port,2000,startVideoProcessor); + try{ + connectionTester.test(strippedHost,e.port,2000,startVideoProcessor); + }catch(err){ + startVideoProcessor(null,{success:true}) + } }else{ startVideoProcessor(null,{success:true}) } @@ -1872,6 +1876,16 @@ module.exports = function(s,config,lang){ if(isNaN(e.cutoff)===true){e.cutoff=15} //start drawing files delete(activeMonitor.childNode) + //validate port + if( + e.type !== 'socket' && + e.type !== 'dashcam' && + e.protocol !== 'udp' && + e.type !== 'local' && + e.details.skip_ping !== '1' + ){ + e.port = e.port ? e.port : e.protocol === 'https' ? '443' : '80' + } launchMonitorProcesses(e) break; default: