if (Log.verbose) Log.info(this, "evaluating PAC script");
String pac = null;
try {
- Object obj = pacFunc.call(url, host, null, null, 2);
- if (Log.verbose) Log.info(this, " PAC script returned \"" + obj + "\"");
- pac = obj.toString();
+ JS obj = pacFunc.call(JS.S(url), JS.S(host), null, null, 2);
+ if (Log.verbose) Log.info(this, " PAC script returned \"" + JS.debugToString(obj) + "\"");
+ pac = JS.toString(obj);
} catch (Throwable e) {
if (Log.on) Log.info(this, "PAC script threw exception " + e);
return null;
return ret;
}
- public static JSScope proxyAutoConfigRootScope = new ProxyAutoConfigRootScope();
+ public static JSScope proxyAutoConfigRootScope = /*new ProxyAutoConfigRootScope();*/ null; // FIXME: New api
public static JS getProxyAutoConfigFunction(String url) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(new HTTP(url, true).GET()));
JS scr = JS.fromReader("PAC script at " + url, 0, new StringReader(script));
JS.cloneWithNewParentScope(scr, proxyAutoConfigRootScope).call(null, null, null, null, 0);
- return (JS)proxyAutoConfigRootScope.get("FindProxyForURL");
+ return (JS)proxyAutoConfigRootScope.get(JS.S("FindProxyForURL"));
} catch (Exception e) {
if (Log.on) {
Log.info(Platform.class, "WPAD detection failed due to:");
- if (e instanceof JSExn) {
+ // I have no idea what this was supposed to do
+ /*if (e instanceof JSExn) {
try {
org.ibex.js.JSArray arr = new org.ibex.js.JSArray();
arr.addElement(((JSExn)e).getObject());
} catch (Exception e2) {
Log.info(Platform.class, e);
}
- }
- else Log.info(Platform.class, e);
+ }*/
+ Log.info(Platform.class, e);
}
return null;
}
// FIXME
//Template.buildTemplate("org/ibex/builtin/proxy_authorization.ibex", Stream.getInputStream((JS)Main.builtin.get("org/ibex/builtin/proxy_authorization.ibex")), new Ibex(null));
t.apply(b);
- b.put("realm", realm);
- b.put("proxyIP", proxyIP);
+ b.put(JS.S("realm"), JS.S(realm));
+ b.put(JS.S("proxyIP"), JS.S(proxyIP));
}
});
// ProxyAutoConfigRootJSScope ////////////////////////////////////////////////////////////////////
- public static class ProxyAutoConfigRootScope extends JSScope.Global {
+ // FIXME: JS Update for new API
+ /*public static class ProxyAutoConfigRootScope extends JSScope.Global {
public ProxyAutoConfigRootScope() { super(); }
return false;
}
public static String[] days = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };
- }
+ }*/
/**