mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-25 20:16:00 +01:00
Add 0.0.0.0 support for webserver and make it the default config value
This commit is contained in:
parent
62c8306b8c
commit
c23335df7c
@ -47,8 +47,9 @@ webserver {
|
||||
enabled: true
|
||||
|
||||
# The IP-Adress that the webserver binds to.
|
||||
# If this setting is commented out, bluemap tries to find the default ip-adress of your system.
|
||||
# Use "0.0.0.0" to bind to all available local adresses.
|
||||
# If you only want to access it locally use "localhost".
|
||||
# Default is "0.0.0.0"
|
||||
#ip: "localhost"
|
||||
#ip: "127.0.0.1"
|
||||
|
||||
|
@ -44,10 +44,11 @@ webserver {
|
||||
# With this setting you can enable the integrated web-server.
|
||||
# Default is disabled
|
||||
enabled: false
|
||||
|
||||
|
||||
# The IP-Adress that the webserver binds to.
|
||||
# If this setting is commented out, bluemap tries to find the default ip-adress of your system.
|
||||
# Use "0.0.0.0" to bind to all available local adresses.
|
||||
# If you only want to access it locally use "localhost".
|
||||
# Default is "0.0.0.0"
|
||||
#ip: "localhost"
|
||||
#ip: "127.0.0.1"
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
@ -109,7 +110,9 @@ private void loadWebConfig(ConfigurationNode node) throws IOException {
|
||||
if (webserverEnabled) {
|
||||
//ip
|
||||
String webserverBindAdressString = node.getNode("ip").getString("");
|
||||
if (webserverBindAdressString.isEmpty()) {
|
||||
if (webserverBindAdressString.isEmpty() || webserverBindAdressString.equals("0.0.0.0") || webserverBindAdressString.equals("::0")) {
|
||||
webserverBindAdress = new InetSocketAddress(0).getAddress(); // 0.0.0.0
|
||||
} else if (webserverBindAdressString.equals("#getLocalHost")) {
|
||||
webserverBindAdress = InetAddress.getLocalHost();
|
||||
} else {
|
||||
webserverBindAdress = InetAddress.getByName(webserverBindAdressString);
|
||||
|
@ -47,8 +47,9 @@ webserver {
|
||||
enabled: true
|
||||
|
||||
# The IP-Adress that the webserver binds to.
|
||||
# If this setting is commented out, bluemap tries to find the default ip-adress of your system.
|
||||
# Use "0.0.0.0" to bind to all available local adresses.
|
||||
# If you only want to access it locally use "localhost".
|
||||
# Default is "0.0.0.0"
|
||||
#ip: "localhost"
|
||||
#ip: "127.0.0.1"
|
||||
|
||||
|
@ -47,8 +47,9 @@ webserver {
|
||||
enabled: true
|
||||
|
||||
# The IP-Adress that the webserver binds to.
|
||||
# If this setting is commented out, bluemap tries to find the default ip-adress of your system.
|
||||
# Use "0.0.0.0" to bind to all available local adresses.
|
||||
# If you only want to access it locally use "localhost".
|
||||
# Default is "0.0.0.0"
|
||||
#ip: "localhost"
|
||||
#ip: "127.0.0.1"
|
||||
|
||||
|
@ -42,8 +42,9 @@ webserver {
|
||||
enabled: true
|
||||
|
||||
# The IP-Adress that the webserver binds to.
|
||||
# If this setting is commented out, bluemap tries to find the default ip-adress of your system.
|
||||
# Use "0.0.0.0" to bind to all available local adresses.
|
||||
# If you only want to access it locally use "localhost".
|
||||
# Default is "0.0.0.0"
|
||||
#ip: "localhost"
|
||||
#ip: "127.0.0.1"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user