-
-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geyser select wrong destination IP address family type when forwarding IP information #4244
Comments
Please send a Geyser dump - additionally, i would recommend to try and set the |
I've tried setting it to IPv6, and IPv6 works but IPv4 would have this problem. diff --git a/core/src/main/java/org/geysermc/geyser/network/netty/LocalSession.java b/core/src/main/java/org/geysermc/geyser/network/netty/LocalSession.java
index 551bc1de..ef2e148f 100644
--- a/core/src/main/java/org/geysermc/geyser/network/netty/LocalSession.java
+++ b/core/src/main/java/org/geysermc/geyser/network/netty/LocalSession.java
@@ -129,7 +129,7 @@ public final class LocalSession extends TcpSession {
}
ctx.channel().writeAndFlush(new HAProxyMessage(
HAProxyProtocolVersion.V2, HAProxyCommand.PROXY, proxiedProtocol,
- clientAddress.getAddress().getHostAddress(), remoteAddress.getAddress().getHostAddress(),
+ clientAddress.getAddress().getHostAddress(), (proxiedProtocol == HAProxyProxiedProtocol.TCP4 ? "127.0.0.1" : "0:0:0:0:0:0:0:1"),
clientAddress.getPort(), remoteAddress.getPort()
));
ctx.pipeline().remove(this);
I don't think forwarding remote address matters in server though. |
Thanks for the code snippet :) |
Yes. I've also updated bug report to correctly describe bug, since |
Describe the bug
When connecting to proxy server (with PROXY protocol support enabled for both ends -
use-proxy-protocol: true
andenable-proxy-protocol: true
), Geyser selected wrong address to set as destination address (in this case source IP is IPv6 but Geyser tried to set destination IP as IPv4).To Reproduce
remote
server (in this case Velocity) and bothuse-proxy-protocol
,enable-proxy-protocol
totrue
::
Expected behaviour
Should select correct destination address and connect like usual.
Screenshots / Videos
Server Version and Plugins
Velocity 3.2.0-SNAPSHOT (git-81b183ac-b276)
Geyser Dump
Haven't configured permission yet so cannot create a dump, sorry.
Geyser Version
2.2.0-SNAPSHOT (git-master-2e68244)
Minecraft: Bedrock Edition Device/Version
1.20.32, Windows
Additional Context
I'm using Docker with IPv6 enabled, but should also be applicable without Docker.
The text was updated successfully, but these errors were encountered: