I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit f7dc55f0 authored by zzz's avatar zzz
Browse files

* HTTP Proxy: Jump and addresshelper page tweaks

parent d9ba62aa
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ import net.i2p.client.naming.NamingService; ...@@ -32,6 +32,7 @@ import net.i2p.client.naming.NamingService;
import net.i2p.client.streaming.I2PSocket; import net.i2p.client.streaming.I2PSocket;
import net.i2p.client.streaming.I2PSocketManager; import net.i2p.client.streaming.I2PSocketManager;
import net.i2p.client.streaming.I2PSocketOptions; import net.i2p.client.streaming.I2PSocketOptions;
import net.i2p.crypto.SHA256Generator;
import net.i2p.data.Base32; import net.i2p.data.Base32;
import net.i2p.data.Base64; import net.i2p.data.Base64;
import net.i2p.data.DataFormatException; import net.i2p.data.DataFormatException;
...@@ -981,8 +982,14 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn ...@@ -981,8 +982,14 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
return; return;
byte[] header = getErrorPage("ahelper-new", ERR_AHELPER_NEW); byte[] header = getErrorPage("ahelper-new", ERR_AHELPER_NEW);
out.write(header); out.write(header);
out.write(("<table><tr><td class=\"mediumtags\" align=\"right\">" + _("Host") + "</td><td class=\"mediumtags\">" + destination + "</td></tr>\n" + out.write(("<table><tr><td class=\"mediumtags\" align=\"right\">" + _("Host") +
"<tr><td class=\"mediumtags\" align=\"right\">" + _("Destination") + "</td><td>" + "</td><td class=\"mediumtags\">" + destination + "</td></tr>\n").getBytes());
try {
String b32 = Base32.encode(SHA256Generator.getInstance().calculateHash(Base64.decode(ahelperKey)).getData());
out.write(("<tr><td class=\"mediumtags\" align=\"right\">" + _("Base 32") + "</td>" +
"<td><a href=\"http://" + b32 + ".b32.i2p/\">" + b32 + ".b32.i2p</a></td></tr>").getBytes());
} catch (Exception e) {}
out.write(("<tr><td class=\"mediumtags\" align=\"right\">" + _("Destination") + "</td><td>" +
"<textarea rows=\"1\" style=\"height: 4em; min-width: 0; min-height: 0;\" cols=\"70\" wrap=\"off\" readonly=\"readonly\" >" + "<textarea rows=\"1\" style=\"height: 4em; min-width: 0; min-height: 0;\" cols=\"70\" wrap=\"off\" readonly=\"readonly\" >" +
ahelperKey + "</textarea></td></tr></table>\n" + ahelperKey + "</textarea></td></tr></table>\n" +
"<hr><div class=\"formaction\">"+ "<hr><div class=\"formaction\">"+
...@@ -1179,7 +1186,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn ...@@ -1179,7 +1186,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
out.write(jurl.getBytes()); out.write(jurl.getBytes());
out.write(uri.getBytes()); out.write(uri.getBytes());
out.write("\">".getBytes()); out.write("\">".getBytes());
out.write(jurl.getBytes()); out.write(jurl.substring(7).getBytes());
out.write(uri.getBytes()); out.write(uri.getBytes());
out.write("</a>\n".getBytes()); out.write("</a>\n".getBytes());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment