Add Virtualhost support for server list pings#1265
Merged
4drian3d merged 6 commits intoPaperMC:dev/3.0.0from Jan 31, 2025
Merged
Add Virtualhost support for server list pings#12654drian3d merged 6 commits intoPaperMC:dev/3.0.0from
4drian3d merged 6 commits intoPaperMC:dev/3.0.0from
Conversation
electronicboy
approved these changes
Mar 5, 2024
4drian3d
approved these changes
Mar 5, 2024
Contributor
Author
|
I added an additional commit to add support for this to the public API so plugins can use it. |
Contributor
Author
|
Although, the public API change I've proposed might not be the best way to go about things. The expected behavior should pretty much always be to use a virtualhost if the player connected with one, but with this method plugin devs have to go out of their way to support it. Shouldn't the easiest way to do things be the correct way? Maybe |
4drian3d
reviewed
Mar 11, 2024
api/src/main/java/com/velocitypowered/api/proxy/server/RegisteredServer.java
Outdated
Show resolved
Hide resolved
…/3.0.0 # Conflicts: # proxy/src/main/java/com/velocitypowered/proxy/server/PingSessionHandler.java
4drian3d
approved these changes
Jan 31, 2025
WiIIiam278
pushed a commit
to WiIIiam278/Velocity
that referenced
this pull request
Mar 24, 2025
* Add virtualhost support for server list pings * Add virtualhost support to ping public API * Applied suggestions * fixed checkstyle * Added nullable annotation --------- Co-authored-by: Adrian <adriangonzalesval@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a player connects to a server through velocity, velocity correctly forwards the virtualhost used to connect. This allows velocity to be run in front of proxy/routing services such as mc-router, and gives the proxying services running behind velocity the information they need to know which final game-server to forward the request to.
However, velocity doesn't forward that information for server list pings, meaning that even with ping passthrough enabled, any proxy/router running behind velocity won't have the information it needs to be able route pings to the correct game-server based on the virtual host. Instead, velocity would just create the ping packet with the host set to whatever was configured in
velocity.toml. This PR fixes that issue, and makes it so virtualhosts are now forwarded with server list pings as well.I'm not super familiar with the velocity codebase as a whole, so if this PR needs any changes to align with the overall goals or structure of the project, I'd be happy to make any requested modifications.