mc-router icon indicating copy to clipboard operation
mc-router copied to clipboard

Documentation for PROXY protocol is missing

Open jemand771 opened this issue 3 years ago • 5 comments

While searching for a way to forward the client IP I found #22 (issue: #13) which has already been released, but the README doesn't contain any info about it. First of all, the usage code block would need something like this:

  -use-proxy-protocol
        Send PROXY protocol to backend servers (env USE_PROXY_PROTOCOL)

And maybe some additional info on configuring the actual minecraft servers to accept the proxy protocol. (I realize that this might be vastly different between server "flavors", but at least a general hint in the right direction would be helpful anyway) The way I have it now, I can't connect to a fabric 1.18.1 server behind mc-router when I enable the proxy protocol, but this might be a config error.

jemand771 avatar Jan 04 '22 18:01 jemand771

cc @Gabitzuu

itzg avatar Jan 04 '22 19:01 itzg

Hi. Yes, I forgot to add the README part regarding PROXY protocol. Basically, your server has to accept this protocol, either by itself (eg. Bungeecord/Waterfall/Velocity *iirc), or by using a plugin (SpigotProxy/FabricProxy-Lite) Sadly, I'm not familiarized with Fabric, so I can't really help you, but this might help: https://www.curseforge.com/minecraft/mc-mods/fabricproxy-lite

Gabitzuu avatar Jan 04 '22 20:01 Gabitzuu

thanks for the quick reply, I'll have to play around with this a bit more. So far I couldn't get it working at all (even with spigot/paper) but I didn't spend much time troubleshooting yet.

Does mc-router implement the "new" (often called "modern") or the legacy forwarding? Most plugins/mods let you configure which one to use (and I should probably pick the right one)

jemand771 avatar Jan 04 '22 22:01 jemand771

@jemand771 it's currently PROXY v2, but I vaguely remember what you mean about some alternate client IP forwarding protocols for Bungee type scenarios. So it might turn out the particular support you're needing isn't here yet.

itzg avatar Jan 05 '22 01:01 itzg

Hmm, the ip_forward feature seems to work by encoding it into the host field of the handshake. That would be doable here in mc-router

https://github.com/SpigotMC/BungeeCord/blob/9c95d4ba43ba84d10e8bb7d7c92d7e6c5f161ed2/proxy/src/main/java/net/md_5/bungee/ServerConnector.java#L108

itzg avatar Jan 05 '22 01:01 itzg