Always resolve hostnames. (Fix #1750)#1751
Open
qyl27 wants to merge 2 commits intoPaperMC:dev/3.0.0from
Open
Conversation
Signed-off-by: 秋雨落 <i@rain.cx>
There was a problem hiding this comment.
Pull request overview
This PR addresses #1750 by ensuring server addresses defined via configuration/CLI are parsed using a resolving address parser so ServerInfo#getAddress() no longer returns an unresolved InetAddress when hostnames are used.
Changes:
- Removed the non-resolving
AddressUtil.parseAddressand switched call sites toAddressUtil.parseAndResolveAddress. - Updated config validation and server registration paths to use the resolving parser for both
bindand[servers]entries. - Updated CLI
--add-serverparsing to use the resolving parser.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| proxy/src/main/java/com/velocitypowered/proxy/util/AddressUtil.java | Removes parseAddress, leaving parseAndResolveAddress as the primary parser (and dropping Guava IP parsing). |
| proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java | Validates bind and [servers] addresses using the resolving parser. |
| proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java | Registers config servers using the resolving parser during start/reload. |
| proxy/src/main/java/com/velocitypowered/proxy/ProxyOptions.java | Parses --add-server values using the resolving parser. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java
Show resolved
Hide resolved
proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java
Show resolved
Hide resolved
proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java
Show resolved
Hide resolved
proxy/src/main/java/com/velocitypowered/proxy/util/AddressUtil.java
Outdated
Show resolved
Hide resolved
proxy/src/main/java/com/velocitypowered/proxy/util/AddressUtil.java
Outdated
Show resolved
Hide resolved
Signed-off-by: 秋雨落 <i@rain.cx>
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.
This PR fixes #1750. It will resolve all the hostnames in the configuration.
We're resolving in
bindbefore, and[servers]are not.