mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fall back to the loopback address when resolving autoconfigured remote (#2090)
This way, if it errors, you're not stuck with 'unknown host: auto' when actually connecting.
This commit is contained in:
parent
70e28604b8
commit
6a88a46b51
1 changed files with 2 additions and 1 deletions
|
@ -160,12 +160,13 @@ public class GeyserConnector {
|
||||||
if (config.isDebugMode()) {
|
if (config.isDebugMode()) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
config.getRemote().setAddress(InetAddress.getLoopbackAddress().getHostAddress());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String remoteAddress = config.getRemote().getAddress();
|
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.
|
// 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")) {
|
if (!remoteAddress.matches(IP_REGEX) && !remoteAddress.equalsIgnoreCase("localhost")) {
|
||||||
|
int remotePort;
|
||||||
try {
|
try {
|
||||||
// Searches for a server address and a port from a SRV record of the specified host name
|
// Searches for a server address and a port from a SRV record of the specified host name
|
||||||
InitialDirContext ctx = new InitialDirContext();
|
InitialDirContext ctx = new InitialDirContext();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue