Oops, forgot to hook up myIpAddress().

This commit is contained in:
Michael Bayne
2019-06-05 15:44:06 -07:00
parent e376dff945
commit 157b12dbfa
3 changed files with 14 additions and 0 deletions
@@ -23,6 +23,10 @@ function dnsResolve (host) {
return resolver.dnsResolve(host)
}
function myIpAddress () {
return resolver.myIpAddress()
}
function isInNet (addrOrHost, pattern, maskstr) {
var testRE = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
var test = testRE.exec(addrOrHost);
@@ -6,6 +6,7 @@
package com.threerings.getdown.launcher;
import java.io.StringReader;
import java.net.InetAddress;
import java.net.URL;
import org.junit.Test;
@@ -133,5 +134,12 @@ public class ProxyUtilTest {
// return 'DIRECT';
// }
// }
String MYIP =
"function FindProxyForURL(url, host) {\n" +
" return 'PROXY ' + myIpAddress() + ':8080';\n" +
"}";
String myIp = InetAddress.getLocalHost().getHostAddress();
testPAC(MYIP, "http://testurl.com/", "PROXY " + myIp + ":8080");
}
}