RealIP
RealIP copied to clipboard
Protocol Documentation
I would like to create a Fabric mod to support TCPShield so I could host a Fabric server protected by TCP Shield. I am not familiar very with the Bukkit stack or the plugins that you depend on, it would be easier to create a mod for this from a protocol specification than figuring out how the plugin works.
Why would you need a mod? The server handles validating the connections, not the client.
The server would need a mod to get the correct IP addresses.
Ah you mean a plugin on the server side, gotcha. You can view how we verify connections here: https://github.com/TCPShield/RealIP/blob/master/src/main/java/net/tcpshield/tcpshield/TCPShieldPacketHandler.java#L89
Essentially, we send a custom hostname from our proxies in the form of "hostname//ip:port//timestamp//signature", the timestamp and signature are used to validate the connection is coming from our proxies to stop IP forging & replay attacks. The IP is then used to replace the TCPShield proxy IP for the player, same with the hostname.
To be clear because some names are inconsistent between different MC namespaces: You mean the packet that is sent to the server in the first stage of a client connecting?
https://github.com/TCPShield/RealIP/blob/master/src/main/java/net/tcpshield/tcpshield/TCPShieldPacketHandler.java#L94
Also this shows that you use ///
instead of //
.
Yes, the hostname packet is how we send the data to the server. Yes, I mean triple slash, not double.
Hostname packet: https://wiki.vg/Protocol#Handshake
This should be a super quick mod to make then. That is super simple.
My mod is available here if you would like to verify that it does what it is supposed to do.
Since the protocol is so simple I would recommend documenting it in the README somewhere.
Bumping this issue up, hoping this mod gets added into the README for other users to find since it was a tad difficult for me personally.
Thanks for this excellent mod as well, gudenau <3