From ef1f5009d333a302927e3266c04903052408e57a Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 23 Sep 2024 03:42:12 +0200 Subject: [PATCH] =?UTF-8?q?Adjust=20HAProxy's=20existance=20to=20log=20whe?= =?UTF-8?q?n=20the=20proxy=20protocol=20is=20enabled=20=E2=80=A6=20(#1436)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adjust HAProxy's existance to log when the proxy protocol is enabled during bind. * Added additional warning message, instead of changing the main one. We can see what the preference would be. --- .../velocitypowered/proxy/network/ConnectionManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/network/ConnectionManager.java b/proxy/src/main/java/com/velocitypowered/proxy/network/ConnectionManager.java index be1db5522..7af894f46 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/network/ConnectionManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/network/ConnectionManager.java @@ -109,6 +109,12 @@ public final class ConnectionManager { final Channel channel = future.channel(); if (future.isSuccess()) { this.endpoints.put(address, new Endpoint(channel, ListenerType.MINECRAFT)); + + // Warn people with console access that HAProxy is in use, see PR: #1436 + if (this.server.getConfiguration().isProxyProtocol()) { + LOGGER.warn("Using HAProxy and listening on {}, please ensure this listener is adequately firewalled.", channel.localAddress()); + } + LOGGER.info("Listening on {}", channel.localAddress()); // Fire the proxy bound event after the socket is bound