diff --git a/main.js b/main.js index 1163ff3..fae1f8e 100644 --- a/main.js +++ b/main.js @@ -194,6 +194,16 @@ function initWebServer(settings) { adapter.log.info('config port: ' + settings.port); + + adapter.getPort(settings.port, function (port) { + if (port != settings.port && !adapter.config.findNextPort) { + adapter.log.error('port ' + settings.port + ' already in use'); + process.exit(1); + } + webServer.listen(port, settings.bind, function() { + adapter.log.info('Server listening on http' + (settings.secure ? 's' : '') + '://' + settings.bind + ':' + port); + }); + }); /* if (settings.port) {