Skip to content

Commit

Permalink
Use the Minecraft server IP for the HTTP server
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Aug 12, 2024
1 parent b39ad7a commit 1b9b751
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class HttpServerManager {

private final TemplatePaperPlugin plugin;

private final String hostName = "localhost";
private final String hostName;
private final int port = 8000;

private final int successResponseCode = 200;
Expand All @@ -44,6 +44,8 @@ public String getSocketAddress() {
public HttpServerManager(TemplatePaperPlugin plugin) {
this.plugin = plugin;

hostName = Bukkit.getServer().getIp();

try {
server = HttpServer.create(new InetSocketAddress(hostName, port), 0);
} catch (IOException exception) {
Expand Down

0 comments on commit 1b9b751

Please sign in to comment.