Skip to content

Commit

Permalink
Dont rely on waifupnp for obtaining the public ip
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Feb 5, 2024
1 parent 6a9817c commit 5c2f556
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/main/java/mpo/dayon/assistant/gui/Assistant.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,9 @@ public void actionPerformed(ActionEvent ev) {
}

private void resolvePublicIp() throws IOException {
publicIp = UPnP.getExternalIP();
if (publicIp == null || publicIp.startsWith("192.168") || publicIp.startsWith("10.")) {
final URL url = new URL(WHATSMYIP_SERVER_URL);
try (final BufferedReader lines = new BufferedReader(new InputStreamReader(url.openStream()))) {
publicIp = lines.readLine();
}
final URL url = new URL(WHATSMYIP_SERVER_URL);
try (final BufferedReader lines = new BufferedReader(new InputStreamReader(url.openStream()))) {
publicIp = lines.readLine();
}
}
};
Expand Down

0 comments on commit 5c2f556

Please sign in to comment.