Local and public address support

This commit is contained in:
Nanit 2020-11-27 00:17:53 +02:00
parent 48dbd584a8
commit fa27356bac
2 changed files with 6 additions and 2 deletions

View File

@ -62,7 +62,11 @@ public final class LimboServer {
.channel(NioServerSocketChannel.class) .channel(NioServerSocketChannel.class)
.childHandler(new ClientChannelInitializer(this)); .childHandler(new ClientChannelInitializer(this));
bootstrap.bind(LimboConfig.getHost(), LimboConfig.getPort()); if (LimboConfig.getHost().isEmpty()){
bootstrap.bind(LimboConfig.getPort());
} else {
bootstrap.bind(LimboConfig.getHost(), LimboConfig.getPort());
}
Logger.info("Server started on %s:%d", LimboConfig.getHost(), LimboConfig.getPort()); Logger.info("Server started on %s:%d", LimboConfig.getHost(), LimboConfig.getPort());
} }

View File

@ -1,6 +1,6 @@
# ======= General Data ======= # # ======= General Data ======= #
# Server's host address # Server's host address. Set it empty to use public address
host=localhost host=localhost
# Server's port # Server's port