Add myIpAddress() to PAC proxy environment.

Also fixed issue with dnsResolve() in same.
This commit is contained in:
Michael Bayne
2019-05-31 09:51:31 -07:00
parent 85c4a0ddc1
commit ce76832835
2 changed files with 13 additions and 1 deletions
@@ -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;
}