From ce7683283572b029e9bd57f4599cd95e9c3d385f Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 31 May 2019 09:51:31 -0700 Subject: [PATCH] Add myIpAddress() to PAC proxy environment. Also fixed issue with dnsResolve() in same. --- CHANGELOG.md | 5 +++++ .../java/com/threerings/getdown/launcher/ProxyUtil.java | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34d4b84..6b44c73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Getdown Releases +## 1.8.6 - Unreleased + +* Fixed issues with PAC proxy support: added `myIpAddress()`, fixed `dnsResolve()`, fixed crash + when detecting PAC proxy. + ## 1.8.5 - May 29, 2019 * Fixed issues with proxy information not getting properly passed through to app. diff --git a/launcher/src/main/java/com/threerings/getdown/launcher/ProxyUtil.java b/launcher/src/main/java/com/threerings/getdown/launcher/ProxyUtil.java index 5665ee2..8962d35 100644 --- a/launcher/src/main/java/com/threerings/getdown/launcher/ProxyUtil.java +++ b/launcher/src/main/java/com/threerings/getdown/launcher/ProxyUtil.java @@ -237,7 +237,14 @@ public final class ProxyUtil { public static class Resolver { public String dnsResolve (String host) { try { - return InetAddress.getByName(host).toString(); + return InetAddress.getByName(host).getHostAddress(); + } catch (UnknownHostException uhe) { + return null; + } + } + public String myIpAddress () { + try { + return InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException uhe) { return null; }