Skip to content

Commit

Permalink
Fall back to the loopback address when resolving autoconfigured remote (
Browse files Browse the repository at this point in the history
GeyserMC#2090)

This way, if it errors, you're not stuck with 'unknown host: auto' when actually connecting.
  • Loading branch information
Camotoy authored Apr 16, 2021
1 parent 70e2860 commit 6a88a46
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ private GeyserConnector(PlatformType platformType, GeyserBootstrap bootstrap) {
if (config.isDebugMode()) {
ex.printStackTrace();
}
config.getRemote().setAddress(InetAddress.getLoopbackAddress().getHostAddress());
}
}
String remoteAddress = config.getRemote().getAddress();
int remotePort = config.getRemote().getPort();
// Filters whether it is not an IP address or localhost, because otherwise it is not possible to find out an SRV entry.
if (!remoteAddress.matches(IP_REGEX) && !remoteAddress.equalsIgnoreCase("localhost")) {
int remotePort;
try {
// Searches for a server address and a port from a SRV record of the specified host name
InitialDirContext ctx = new InitialDirContext();
Expand Down

0 comments on commit 6a88a46

Please sign in to comment.