Fix webserver only working after plugin reload

This commit is contained in:
Lukas Rieger (Blue) 2023-02-23 10:54:17 +01:00
parent d4f0dbec5b
commit 0123041925
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
1 changed files with 2 additions and 3 deletions

View File

@ -191,14 +191,13 @@ public class Plugin implements ServerEventListener {
); );
} }
webServer = new WebServer(routingRequestHandler);
webServer.start();
try { try {
webServer = new WebServer(routingRequestHandler);
webServer.bind(new InetSocketAddress( webServer.bind(new InetSocketAddress(
webserverConfig.resolveIp(), webserverConfig.resolveIp(),
webserverConfig.getPort() webserverConfig.getPort()
)); ));
webServer.start();
} catch (UnknownHostException ex) { } catch (UnknownHostException ex) {
throw new ConfigurationException("BlueMap failed to resolve the ip in your webserver-config.\n" + throw new ConfigurationException("BlueMap failed to resolve the ip in your webserver-config.\n" +
"Check if that is correctly configured.", ex); "Check if that is correctly configured.", ex);