/** * If PROP_PREFER_HTTPS is true or unset, * return https URL unless console is http only. Default https://127.0.0.1:7667/ * If PROP_PREFER_HTTPS is set to false, * return http URL unless console is https only. Default http://127.0.0.1:7657/ * * @since 0.9.33 consolidated from i2ptunnel and desktopgui */ public String getConsoleURL() { return getConsoleURL(I2PAppContext.getGlobalContext().getBooleanPropertyDefaultTrue(PROP_PREFER_HTTPS)); }
String url = ctx.portMapper().getConsoleURL(); if (!url.equals("http://127.0.0.1:7657/")) { DataHelper.replace(out, "http://127.0.0.1:7657/", url);
/** * ClientApp constructor used from clients.config * * @param mgr null OK * @param args URL in args[0] or null args for router console * @since 0.9.18 */ public UrlLauncher(I2PAppContext context, ClientAppManager mgr, String[] args) { _state = UNINITIALIZED; _context = context; _log = _context.logManager().getLog(UrlLauncher.class); _mgr = mgr; if (args == null || args.length <= 0) args = new String[] { context.portMapper().getConsoleURL() }; _args = args; _shellCommand = new ShellCommand(); _state = INITIALIZED; }
/** * Obsolete, now uses ClientApp interface */ public static void main(String args[]) { UrlLauncher launcher = new UrlLauncher(); try { if (args.length > 0) launcher.openUrl(args[0]); else launcher.openUrl(I2PAppContext.getGlobalContext().portMapper().getConsoleURL()); } catch (IOException e) {} } }
/** * Build the console URL with info from the port mapper, * and launch the browser at it. * * Modified from I2PTunnelHTTPClientBase. * * @since 0.9.26 */ private void launchBrowser() { // null args ok UrlLauncher launcher = new UrlLauncher(_context, null, null); String url = _context.portMapper().getConsoleURL(); try { launcher.openUrl(url); } catch (IOException e1) { log.log(Log.WARN, "Failed to open browser!", e1); } } }
String conURL = pm.getConsoleURL(); out.write(("HTTP/1.1 200 OK\r\n"+ "Content-Type: text/html; charset=UTF-8\r\n"+
Hash h2 = ConvertToHash.getHash(ahelperKey); if (h1 != null && h2 != null) { String conURL = _context.portMapper().getConsoleURL(); out.write(("\n<table class=\"conflict\"><tr><th align=\"center\">" + "<a href=\"" + trustedURL + "\">").getBytes("UTF-8"));