Listener l = createListener(addr, port, base, simulator, usePlugins);
Listener l = createListener(addr, port, base, simulator, usePlugins, primary);
    private void createListeners() {        String prop = "Proxy.listeners";        String value = Preferences.getPreference(prop);        if (value == null || value.trim().equals("")) {            _logger.warning("No proxies configured!?");            value = "127.0.0.1:8008";        }        String[] listeners = value.trim().split(" *,+ *");                String addr;        int port = 0;        HttpUrl base;        boolean usePlugins = false;        String simulator = null;                for (int i=0; i<listeners.length; i++) {            addr = listeners[i].substring(0, listeners[i].indexOf(":"));            try {                port = Integer.parseInt(listeners[i].substring(listeners[i].indexOf(":")+1).trim());            } catch (NumberFormatException nfe) {                System.err.println("Error parsing port for " + listeners[i] + ", skipping it!");                continue;            }            prop = "Proxy.listener." + listeners[i] + ".base";            value = Preferences.getPreference(prop, "");            if (value.equals("")) {                base = null;            } else {                try {                    base = new HttpUrl(value);                } catch (MalformedURLException mue) {                    _logger.severe("Malformed 'base' parameter for listener '"+listeners[i]+"'");                    break;                }            }                        prop = "Proxy.listener." + listeners[i] + ".useplugins";            value = Preferences.getPreference(prop, "true");                        if (value == null || value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes")) {                usePlugins = true;            } else {                usePlugins = false;            }                        prop = "Proxy.listener." + listeners[i] + ".simulator";            value = Preferences.getPreference(prop, "Unlimited");                        if (!value.trim().equals("") && _simulators.containsKey(value)) {                simulator = value;            } else {                _logger.warning("Unknown network simulator '" + value + "'");            }                        try {                Listener l = createListener(addr, port, base, simulator, usePlugins);            } catch (IOException ioe) {                _logger.severe("Error starting proxy (" + addr + ":" + port + " " + base + " " + ioe);            }        }    }