Skip to content
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

Protocol Documentation #79

Open
gudenau opened this issue Mar 5, 2022 · 9 comments
Open

Protocol Documentation #79

gudenau opened this issue Mar 5, 2022 · 9 comments

Comments

@gudenau
Copy link

gudenau commented Mar 5, 2022

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.

@DylanKeir
Copy link
Member

Why would you need a mod? The server handles validating the connections, not the client.

@gudenau
Copy link
Author

gudenau commented Mar 5, 2022

The server would need a mod to get the correct IP addresses.

@DylanKeir
Copy link
Member

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.

@gudenau
Copy link
Author

gudenau commented Mar 5, 2022

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?

@gudenau
Copy link
Author

gudenau commented Mar 5, 2022

@DylanKeir
Copy link
Member

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

@gudenau
Copy link
Author

gudenau commented Mar 5, 2022

This should be a super quick mod to make then. That is super simple.

@gudenau
Copy link
Author

gudenau commented Mar 6, 2022

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.

@JosTheDude
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants