Changeset 12c7871
- Timestamp:
- Feb 19, 2018 11:12:06 PM (3 years ago)
- Branches:
- master
- Children:
- b77524c
- Parents:
- 88c7abe
- Location:
- apps
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java
r88c7abe r12c7871 767 767 Hash h2 = ConvertToHash.getHash(ahelperKey); 768 768 if (h1 != null && h2 != null) { 769 // Do we need to replace http://127.0.0.1:7657 770 // Get the registered host and port from the PortMapper. 771 final String unset = "*unset*"; 772 final String httpHost = _context.portMapper().getActualHost(PortMapper.SVC_CONSOLE, unset); 773 final String httpsHost = _context.portMapper().getActualHost(PortMapper.SVC_HTTPS_CONSOLE, unset); 774 final int httpPort = _context.portMapper().getPort(PortMapper.SVC_CONSOLE, 7657); 775 final int httpsPort = _context.portMapper().getPort(PortMapper.SVC_HTTPS_CONSOLE, -1); 776 final boolean httpsOnly = httpsPort > 0 && httpHost.equals(unset) && !httpsHost.equals(unset); 777 final int cport = httpsOnly ? httpsPort : httpPort; 778 String chost = httpsOnly ? httpsHost : httpHost; 779 if (chost.equals(unset)) 780 chost = "127.0.0.1"; 781 String chostport; 782 if (httpsOnly || cport != 7657 || !chost.equals("127.0.0.1")) 783 chostport = (httpsOnly ? "https://" : "http://") + chost + ':' + cport; 784 else 785 chostport = "http://127.0.0.1:7657"; 769 String conURL = _context.portMapper().getConsoleURL(); 786 770 out.write(("\n<table class=\"conflict\"><tr><th align=\"center\">" + 787 771 "<a href=\"" + trustedURL + "\">").getBytes("UTF-8")); … … 793 777 "<a href=\"" + trustedURL + "\">" + 794 778 "<img src=\"" + 795 c hostport + "/imagegen/id?s=160&c=" +779 conURL + "imagegen/id?s=160&c=" + 796 780 h1.toBase64().replace("=", "%3d") + 797 781 "\" width=\"160\" height=\"160\"></a>\n").getBytes("UTF-8")); … … 799 783 "<a href=\"" + conflictURL + "\">" + 800 784 "<img src=\"" + 801 c hostport + "/imagegen/id?s=160&c=" +785 conURL + "imagegen/id?s=160&c=" + 802 786 h2.toBase64().replace("=", "%3d") + 803 787 "\" width=\"160\" height=\"160\"></a>\n").getBytes("UTF-8")); -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java
r88c7abe r12c7871 199 199 else 200 200 tbook = book; 201 202 String conURL = I2PAppContext.getGlobalContext().portMapper().getConsoleURL(); 201 203 out.write(("HTTP/1.1 200 OK\r\n"+ 202 204 "Content-Type: text/html; charset=UTF-8\r\n"+ … … 212 214 "</head><body>\n" + 213 215 "<div class=logo>\n" + 214 "<a href=\" http://127.0.0.1:7657/\" title=\"" + _t("Router Console") + "\"><img src=\"http://proxy.i2p/themes/console/images/i2plogo.png\" alt=\"I2P Router Console\" border=\"0\"></a><hr>\n" +215 "<a href=\" http://127.0.0.1:7657/config\">" + _t("Configuration") + "</a> <a href=\"http://127.0.0.1:7657/help.jsp\">" + _t("Help") + "</a> <a href=\"http://127.0.0.1:7657/susidns/index\">" + _t("Addressbook") + "</a>\n" +216 "<a href=\"" + conURL + "\" title=\"" + _t("Router Console") + "\"><img src=\"http://proxy.i2p/themes/console/images/i2plogo.png\" alt=\"I2P Router Console\" border=\"0\"></a><hr>\n" + 217 "<a href=\"" + conURL + "config\">" + _t("Configuration") + "</a> <a href=\"" + conURL + "help.jsp\">" + _t("Help") + "</a> <a href=\"" + conURL + "susidns/index\">" + _t("Addressbook") + "</a>\n" + 216 218 "</div>" + 217 219 "<div class=warning id=warning>\n" + -
apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java
r88c7abe r12c7871 90 90 _mgr = mgr; 91 91 if (args == null || args.length <= 0) 92 args = new String[] { "http://127.0.0.1:7657/index.jsp"};92 args = new String[] { context.portMapper().getConsoleURL() }; 93 93 _args = args; 94 94 _shellCommand = new ShellCommand(); … … 356 356 launcher.openUrl(args[0]); 357 357 else 358 launcher.openUrl( "http://127.0.0.1:7657/index.jsp");358 launcher.openUrl(I2PAppContext.getGlobalContext().portMapper().getConsoleURL()); 359 359 } catch (IOException e) {} 360 360 }
Note: See TracChangeset
for help on using the changeset viewer.