Skip to content

Commit 2c44c6e

Browse files
committed
Log original remote address on Bukkit
1 parent d644851 commit 2c44c6e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</execution>
3737
</executions>
3838
<configuration>
39-
<minmizeJar>true</minmizeJar>
39+
<minmizeJar>false</minmizeJar>
4040
<shadedArtifactAttached>false</shadedArtifactAttached>
4141
<createDependencyReducedPom>false</createDependencyReducedPom>
4242
</configuration>

src/main/java/net/andylizi/haproxydetector/HAProxyDetectorHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) thro
5959
case DETECTED:
6060
default:
6161
try {
62-
ctx.pipeline().replace(this, "haproxy-decoder", new HAProxyMessageDecoder(true));
62+
ctx.pipeline().replace(this, "haproxy-decoder", new HAProxyMessageDecoder());
6363
} catch (IllegalArgumentException ignored) {
6464
ctx.pipeline().remove(this); // decoder already exists
6565
}

src/main/java/net/andylizi/haproxydetector/bukkit/HAProxyMessageHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public HAProxyMessageHandler(Object networkManager) {
4747
@Override
4848
public void channelRead0(ChannelHandlerContext ctx, HAProxyMessage msg) throws Exception {
4949
SocketAddress realAddress = new InetSocketAddress(msg.sourceAddress(), msg.sourcePort());
50-
BukkitMain.logger.log(Level.INFO, "Set remote address via proxy to {0}", realAddress);
50+
BukkitMain.logger.log(Level.INFO, "Set remote address via proxy {0} -> {1}",
51+
new Object[] { ctx.channel().remoteAddress(), realAddress });
5152
try {
5253
addressSetter.invokeExact(realAddress);
5354
} catch (Throwable e) {

0 commit comments

Comments
 (0)