* HTTP Proxy:

- Add support for error page translations
      - Add support for external pages for all errors
      - Fix lack of \r in error page headers
      - HTML transitional fixes
      - Cleanups
This commit is contained in:
zzz
2009-11-14 15:05:44 +00:00
parent 1c25c0f408
commit c393e70ca9
14 changed files with 219 additions and 81 deletions

View File

@ -3,8 +3,10 @@
*/ */
package net.i2p.i2ptunnel; package net.i2p.i2ptunnel;
import java.io.ByteArrayOutputStream;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
@ -15,6 +17,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Properties; import java.util.Properties;
import java.util.StringTokenizer; import java.util.StringTokenizer;
@ -55,6 +58,10 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
private HashMap addressHelpers = new HashMap(); private HashMap addressHelpers = new HashMap();
/**
* These are backups if the xxx.ht error page is missing.
*/
private final static byte[] ERR_REQUEST_DENIED = private final static byte[] ERR_REQUEST_DENIED =
("HTTP/1.1 403 Access Denied\r\n"+ ("HTTP/1.1 403 Access Denied\r\n"+
"Content-Type: text/html; charset=iso-8859-1\r\n"+ "Content-Type: text/html; charset=iso-8859-1\r\n"+
@ -77,6 +84,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
"Could not find the following Destination:<BR><BR><div>") "Could not find the following Destination:<BR><BR><div>")
.getBytes(); .getBytes();
/*****
private final static byte[] ERR_TIMEOUT = private final static byte[] ERR_TIMEOUT =
("HTTP/1.1 504 Gateway Timeout\r\n"+ ("HTTP/1.1 504 Gateway Timeout\r\n"+
"Content-Type: text/html; charset=iso-8859-1\r\n"+ "Content-Type: text/html; charset=iso-8859-1\r\n"+
@ -88,6 +96,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
"destination may have issues. Could not get a response from "+ "destination may have issues. Could not get a response from "+
"the following Destination:<BR><BR>") "the following Destination:<BR><BR>")
.getBytes(); .getBytes();
*****/
private final static byte[] ERR_NO_OUTPROXY = private final static byte[] ERR_NO_OUTPROXY =
("HTTP/1.1 503 Service Unavailable\r\n"+ ("HTTP/1.1 503 Service Unavailable\r\n"+
@ -108,11 +117,11 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
"The addresshelper link you followed specifies a different destination key "+ "The addresshelper link you followed specifies a different destination key "+
"than a host entry in your host database. "+ "than a host entry in your host database. "+
"Someone could be trying to impersonate another eepsite, "+ "Someone could be trying to impersonate another eepsite, "+
"or people have given two eepsites identical names.<P/>"+ "or people have given two eepsites identical names.<p>"+
"You can resolve the conflict by considering which key you trust, "+ "You can resolve the conflict by considering which key you trust, "+
"and either discarding the addresshelper link, "+ "and either discarding the addresshelper link, "+
"discarding the host entry from your host database, "+ "discarding the host entry from your host database, "+
"or naming one of them differently.<P/>") "or naming one of them differently.<p>")
.getBytes(); .getBytes();
private final static byte[] ERR_BAD_PROTOCOL = private final static byte[] ERR_BAD_PROTOCOL =
@ -376,22 +385,16 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
// Did addresshelper key conflict? // Did addresshelper key conflict?
if (ahelperConflict) if (ahelperConflict)
{ {
String str;
byte[] header;
str = FileUtil.readTextFile((new File(_errorDir, "ahelper-conflict-header.ht")).getAbsolutePath(), 100, true);
if (str != null) header = str.getBytes();
else header = ERR_AHELPER_CONFLICT;
if (out != null) { if (out != null) {
// Fixme untranslated
long alias = I2PAppContext.getGlobalContext().random().nextLong(); long alias = I2PAppContext.getGlobalContext().random().nextLong();
String trustedURL = protocol + uriPath + urlEncoding; String trustedURL = protocol + uriPath + urlEncoding;
String conflictURL = protocol + alias + ".i2p/?" + initialFragments; String conflictURL = protocol + alias + ".i2p/?" + initialFragments;
byte[] header = getErrorPage("ahelper-conflict", ERR_AHELPER_CONFLICT);
out.write(header); out.write(header);
out.write(("To visit the destination in your host database, click <a href=\"" + trustedURL + "\">here</a>. To visit the conflicting addresshelper link by temporarily giving it a random alias, click <a href=\"" + conflictURL + "\">here</a>.<P/>").getBytes()); out.write(("To visit the destination in your host database, click <a href=\"" + trustedURL + "\">here</a>. To visit the conflicting addresshelper link by temporarily giving it a random alias, click <a href=\"" + conflictURL + "\">here</a>.<p></div>").getBytes());
out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br />Generated on: ".getBytes()); writeFooter(out);
out.write(new Date().toString().getBytes());
out.write("</i></div></body></html>\n".getBytes());
out.flush();
} }
s.close(); s.close();
return; return;
@ -408,11 +411,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
line = method + " " + request.substring(pos); line = method + " " + request.substring(pos);
} else if (host.toLowerCase().equals("localhost") || host.equals("127.0.0.1")) { } else if (host.toLowerCase().equals("localhost") || host.equals("127.0.0.1")) {
if (out != null) { if (out != null) {
out.write(ERR_LOCALHOST); out.write(getErrorPage("localhost", ERR_LOCALHOST));
out.write("<p /><i>Generated on: ".getBytes()); writeFooter(out);
out.write(new Date().toString().getBytes());
out.write("</i></body></html>\n".getBytes());
out.flush();
} }
s.close(); s.close();
return; return;
@ -430,11 +430,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
_log.warn(getPrefix(requestId) + "Host wants to be outproxied, but we dont have any!"); _log.warn(getPrefix(requestId) + "Host wants to be outproxied, but we dont have any!");
l.log("No HTTP outproxy found for the request."); l.log("No HTTP outproxy found for the request.");
if (out != null) { if (out != null) {
out.write(ERR_NO_OUTPROXY); out.write(getErrorPage("noproxy", ERR_NO_OUTPROXY));
out.write("<p /><i>Generated on: ".getBytes()); writeFooter(out);
out.write(new Date().toString().getBytes());
out.write("</i></body></html>\n".getBytes());
out.flush();
} }
s.close(); s.close();
return; return;
@ -449,11 +446,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
if (pos < 0) { if (pos < 0) {
l.log("Invalid request url [" + request + "]"); l.log("Invalid request url [" + request + "]");
if (out != null) { if (out != null) {
out.write(ERR_REQUEST_DENIED); out.write(getErrorPage("denied", ERR_REQUEST_DENIED));
out.write("<p /><i>Generated on: ".getBytes()); writeFooter(out);
out.write(new Date().toString().getBytes());
out.write("</i></body></html>\n".getBytes());
out.flush();
} }
s.close(); s.close();
return; return;
@ -540,13 +534,10 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
l.log("No HTTP method found in the request."); l.log("No HTTP method found in the request.");
if (out != null) { if (out != null) {
if ("http://".equalsIgnoreCase(protocol)) if ("http://".equalsIgnoreCase(protocol))
out.write(ERR_REQUEST_DENIED); out.write(getErrorPage("denied", ERR_REQUEST_DENIED));
else else
out.write(ERR_BAD_PROTOCOL); out.write(getErrorPage("protocol", ERR_BAD_PROTOCOL));
out.write("<p /><i>Generated on: ".getBytes()); writeFooter(out);
out.write(new Date().toString().getBytes());
out.write("</i></body></html>\n".getBytes());
out.flush();
} }
s.close(); s.close();
return; return;
@ -568,23 +559,18 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
//l.log("Could not resolve " + destination + "."); //l.log("Could not resolve " + destination + ".");
if (_log.shouldLog(Log.WARN)) if (_log.shouldLog(Log.WARN))
_log.warn("Unable to resolve " + destination + " (proxy? " + usingWWWProxy + ", request: " + targetRequest); _log.warn("Unable to resolve " + destination + " (proxy? " + usingWWWProxy + ", request: " + targetRequest);
String str;
byte[] header; byte[] header;
boolean showAddrHelper = false; boolean showAddrHelper = false;
if (usingWWWProxy) if (usingWWWProxy)
str = FileUtil.readTextFile((new File(_errorDir, "dnfp-header.ht")).getAbsolutePath(), 100, true); header = getErrorPage("dnfp", ERR_DESTINATION_UNKNOWN);
else if(ahelper != 0) else if(ahelper != 0)
str = FileUtil.readTextFile((new File(_errorDir, "dnfb-header.ht")).getAbsolutePath(), 100, true); header = getErrorPage("dnfb", ERR_DESTINATION_UNKNOWN);
else if (destination.length() == 60 && destination.endsWith(".b32.i2p")) else if (destination.length() == 60 && destination.endsWith(".b32.i2p"))
str = FileUtil.readTextFile((new File(_errorDir, "dnf-header.ht")).getAbsolutePath(), 100, true); header = getErrorPage("dnf", ERR_DESTINATION_UNKNOWN);
else { else {
str = FileUtil.readTextFile((new File(_errorDir, "dnfh-header.ht")).getAbsolutePath(), 100, true); header = getErrorPage("dnfh", ERR_DESTINATION_UNKNOWN);
showAddrHelper = true; showAddrHelper = true;
} }
if (str != null)
header = str.getBytes();
else
header = ERR_DESTINATION_UNKNOWN;
writeErrorMessage(header, out, targetRequest, usingWWWProxy, destination, showAddrHelper); writeErrorMessage(header, out, targetRequest, usingWWWProxy, destination, showAddrHelper);
s.close(); s.close();
return; return;
@ -658,6 +644,64 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
} }
} }
/**
* foo => errordir/foo-header_xx.ht for lang xx, or errordir/foo-header.ht,
* or the backup byte array on fail.
*
* .ht files must be UTF-8 encoded and use \r\n terminators so the
* HTTP headers are conformant.
* We can't use FileUtil.readFile() because it strips \r
*
* @return non-null
*/
private byte[] getErrorPage(String base, byte[] backup) {
return getErrorPage(getTunnel().getContext(), base, backup);
}
private static byte[] getErrorPage(I2PAppContext ctx, String base, byte[] backup) {
File errorDir = new File(ctx.getBaseDir(), "docs");
String lang = ctx.getProperty("routerconsole.lang", Locale.getDefault().getLanguage());
if (lang != null && lang.length() > 0 && !lang.equals("en")) {
File file = new File(errorDir, base + "-header_" + lang + ".ht");
try {
return readFile(file);
} catch (IOException ioe) {
// try the english version now
}
}
File file = new File(errorDir, base + "-header.ht");
try {
return readFile(file);
} catch (IOException ioe) {
return backup;
}
}
private static byte[] readFile(File file) throws IOException {
FileInputStream fis = null;
byte[] buf = new byte[512];
ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
try {
int len = 0;
fis = new FileInputStream(file);
while ((len = fis.read(buf)) > 0) {
baos.write(buf, 0, len);
}
return baos.toByteArray();
} finally {
try { if (fis != null) fis.close(); } catch (IOException foo) {}
}
// we won't ever get here
}
private static void writeFooter(OutputStream out) throws IOException {
// the css is hiding this div for now, but we'll keep it here anyway
out.write("<div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br>Generated on: ".getBytes());
out.write(new Date().toString().getBytes());
out.write("</i></div></body></html>\n".getBytes());
out.flush();
}
private static class OnTimeout implements Runnable { private static class OnTimeout implements Runnable {
private Socket _socket; private Socket _socket;
private OutputStream _out; private OutputStream _out;
@ -705,9 +749,10 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
out.write("\">http://".getBytes()); out.write("\">http://".getBytes());
out.write(uri.getBytes()); out.write(uri.getBytes());
out.write("</a>".getBytes()); out.write("</a>".getBytes());
if (usingWWWProxy) out.write(("<br />WWW proxy: " + wwwProxy).getBytes()); if (usingWWWProxy) out.write(("<br>WWW proxy: " + wwwProxy).getBytes());
if (showAddrHelper) { if (showAddrHelper) {
out.write("<br /><br />Click a link below to look for an address helper by using a \"jump\" service:<br />".getBytes()); // Fixme untranslated
out.write("<br><br>Click a link below to look for an address helper by using a \"jump\" service:<br>".getBytes());
for (int i = 0; i < jumpServers.length; i++) { for (int i = 0; i < jumpServers.length; i++) {
// Skip jump servers we don't know // Skip jump servers we don't know
String jumphost = jumpServers[i].substring(7); // "http://" String jumphost = jumpServers[i].substring(7); // "http://"
@ -719,7 +764,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
continue; continue;
} }
out.write("<br /><a href=\"".getBytes()); out.write("<br><a href=\"".getBytes());
out.write(jumpServers[i].getBytes()); out.write(jumpServers[i].getBytes());
out.write(uri.getBytes()); out.write(uri.getBytes());
out.write("\">".getBytes()); out.write("\">".getBytes());
@ -729,10 +774,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
} }
} }
} }
out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br />Generated on: ".getBytes()); out.write("</div>".getBytes());
out.write(new Date().toString().getBytes()); writeFooter(out);
out.write("</i></div></body></html>\n".getBytes());
out.flush();
} }
} }
@ -744,16 +787,11 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
// _log.warn(getPrefix(requestId) + "Error sending to " + wwwProxy + " (proxy? " + usingWWWProxy + ", request: " + targetRequest, ex); // _log.warn(getPrefix(requestId) + "Error sending to " + wwwProxy + " (proxy? " + usingWWWProxy + ", request: " + targetRequest, ex);
if (out != null) { if (out != null) {
try { try {
String str;
byte[] header; byte[] header;
if (usingWWWProxy) if (usingWWWProxy)
str = FileUtil.readTextFile((new File(_errorDir, "dnfp-header.ht")).getAbsolutePath(), 100, true); header = getErrorPage(I2PAppContext.getGlobalContext(), "dnfp", ERR_DESTINATION_UNKNOWN);
else else
str = FileUtil.readTextFile((new File(_errorDir, "dnf-header.ht")).getAbsolutePath(), 100, true); header = getErrorPage(I2PAppContext.getGlobalContext(), "dnf", ERR_DESTINATION_UNKNOWN);
if (str != null)
header = str.getBytes();
else
header = ERR_DESTINATION_UNKNOWN;
writeErrorMessage(header, out, targetRequest, usingWWWProxy, wwwProxy, false); writeErrorMessage(header, out, targetRequest, usingWWWProxy, wwwProxy, false);
} catch (IOException ioe) { } catch (IOException ioe) {
// static // static

View File

@ -333,7 +333,7 @@
--> -->
<!-- Since the logo moved, we have to update the error pages --> <!-- Since the logo moved, we have to update the error pages -->
<copy todir="pkg-temp/docs/" > <copy todir="pkg-temp/docs/" >
<fileset dir="installer/resources/" includes="*-header.ht" /> <fileset dir="installer/resources/proxy" />
</copy> </copy>
<!-- make a "classic" theme --> <!-- make a "classic" theme -->
<copy todir="pkg-temp/docs/themes/console/classic/" > <copy todir="pkg-temp/docs/themes/console/classic/" >
@ -372,7 +372,7 @@
<target name="prepconsoleDocs" depends="prepgeoupdate"> <target name="prepconsoleDocs" depends="prepgeoupdate">
<copy todir="pkg-temp/docs/" > <copy todir="pkg-temp/docs/" >
<fileset dir="." includes="readme*.html" /> <fileset dir="." includes="readme*.html" />
<fileset dir="installer/resources/" includes="*-header.ht" /> <fileset dir="installer/resources/proxy" />
</copy> </copy>
</target> </target>
<target name="consoleDocs" depends="deletepkg-temp, prepconsoleDocs"> <target name="consoleDocs" depends="deletepkg-temp, prepconsoleDocs">

View File

@ -196,9 +196,14 @@ public class FileUtil {
* Read in the last few lines of a (newline delimited) textfile, or null if * Read in the last few lines of a (newline delimited) textfile, or null if
* the file doesn't exist. * the file doesn't exist.
* *
* Warning - this inefficiently allocates a StringBuilder of size maxNumLines*80,
* so don't make it too big.
* Warning - converts \r\n to \n
*
* @param startAtBeginning if true, read the first maxNumLines, otherwise read * @param startAtBeginning if true, read the first maxNumLines, otherwise read
* the last maxNumLines * the last maxNumLines
* @param maxNumLines max number of lines (or -1 for unlimited) * @param maxNumLines max number of lines (or -1 for unlimited)
* @return string or null; does not throw IOException.
* *
*/ */
public static String readTextFile(String filename, int maxNumLines, boolean startAtBeginning) { public static String readTextFile(String filename, int maxNumLines, boolean startAtBeginning) {

View File

@ -1,3 +1,13 @@
2009-11-14 zzz
* HTTP Proxy:
- Add support for error page translations
- Add support for external pages for all errors
- Fix lack of \r in error page headers
- HTML transitional fixes
- Cleanups
* UDP PeerTestManager: Throw in some synchronization to
try to fix stuck tests
2009-11-11 zzz 2009-11-11 zzz
* Console: Some colon cleansing * Console: Some colon cleansing
* FloodfillPeerSelector: Adjustments * FloodfillPeerSelector: Adjustments

View File

@ -1,17 +1,17 @@
HTTP/1.1 409 Conflict HTTP/1.1 409 Conflict
Content-Type: text/html; charset=iso-8859-1 Content-Type: text/html; charset=UTF-8
Cache-control: no-cache Cache-control: no-cache
Connection: close Connection: close
Proxy-Connection: close Proxy-Connection: close
<html><head> <html><head>
<title>I2P Warning: Destination key conflict</title> <title>I2P Warning: Destination key conflict</title>
<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" /> <link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" /> <link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
</head> </head>
<body> <body>
<div class=logo> <div class=logo>
<a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"/></a><hr> <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
<a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a> <a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a>
</div> </div>
<div class=warning id=warning> <div class=warning id=warning>
@ -20,9 +20,9 @@ The addresshelper link you followed specifies a different destination key
than a host entry in your host database. than a host entry in your host database.
Someone could be trying to impersonate another eepsite, Someone could be trying to impersonate another eepsite,
or people have given two eepsites identical names. or people have given two eepsites identical names.
<P/> <p>
You can resolve the conflict by considering which key you trust, You can resolve the conflict by considering which key you trust,
and either discarding the addresshelper link, and either discarding the addresshelper link,
discarding the host entry from your host database, discarding the host entry from your host database,
or naming one of them differently. or naming one of them differently.
<P/> <p>

View File

@ -0,0 +1,20 @@
HTTP/1.1 403 Request Denied
Content-Type: text/html; charset=UTF-8
Cache-control: no-cache
Connection: close
Proxy-Connection: close
<html><head>
<title>I2P Warning: Request Denied</title>
<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
</head>
<body>
<div class=logo>
<a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
<a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a>
</div>
<div class=warning id=warning>
<h3>Warning: Request Denied</h3>
You attempted to connect to a non-I2P website or location.
</div>

View File

@ -1,17 +1,17 @@
HTTP/1.1 504 Gateway Timeout HTTP/1.1 504 Gateway Timeout
Content-Type: text/html; charset=iso-8859-1 Content-Type: text/html; charset=UTF-8
Cache-control: no-cache Cache-control: no-cache
Connection: close Connection: close
Proxy-Connection: close Proxy-Connection: close
<html><head> <html><head>
<title>I2P Warning: Eepsite not reachable</title> <title>I2P Warning: Eepsite not reachable</title>
<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" /> <link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" /> <link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
</head> </head>
<body> <body>
<div class=logo> <div class=logo>
<a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"/></a><hr> <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
<a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/index.jsp">Addressbook</a> <a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/index.jsp">Addressbook</a>
</div> </div>
<div class=warning id=warning> <div class=warning id=warning>

View File

@ -1,17 +1,17 @@
HTTP/1.1 400 Destination Not Found HTTP/1.1 400 Destination Not Found
Content-Type: text/html; charset=iso-8859-1 Content-Type: text/html; charset=UTF-8
Cache-control: no-cache Cache-control: no-cache
Connection: close Connection: close
Proxy-Connection: close Proxy-Connection: close
<html><head> <html><head>
<title>I2P Warning: Invalid eepsite destination</title> <title>I2P Warning: Invalid eepsite destination</title>
<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" /> <link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" /> <link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
</head> </head>
<body> <body>
<div class=logo> <div class=logo>
<a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"/></a><hr> <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
<a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a> <a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a>
</div> </div>
<div class=warning id=warning> <div class=warning id=warning>

View File

@ -1,17 +1,17 @@
HTTP/1.1 404 Domain Not Found HTTP/1.1 404 Domain Not Found
Content-Type: text/html; charset=iso-8859-1 Content-Type: text/html; charset=UTF-8
Cache-control: no-cache Cache-control: no-cache
Connection: close Connection: close
Proxy-Connection: close Proxy-Connection: close
<html><head> <html><head>
<title>I2P Warning: Eepsite unknown</title> <title>I2P Warning: Eepsite unknown</title>
<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" /> <link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" /> <link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
</head> </head>
<body> <body>
<div class=logo> <div class=logo>
<a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"/></a><hr> <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
<a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/index.jsp">Addressbook</a> <a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/index.jsp">Addressbook</a>
</div> </div>
<div class=warning id=warning> <div class=warning id=warning>

View File

@ -1,17 +1,17 @@
HTTP/1.1 504 Gateway Timeout HTTP/1.1 504 Gateway Timeout
Content-Type: text/html; charset=iso-8859-1 Content-Type: text/html; charset=UTF-8
Cache-control: no-cache Cache-control: no-cache
Connection: close Connection: close
Proxy-Connection: close Proxy-Connection: close
<html><head> <html><head>
<title>I2P Warning: Outproxy Not Found</title> <title>I2P Warning: Outproxy Not Found</title>
<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" /> <link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" /> <link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
</head> </head>
<body> <body>
<div class=logo> <div class=logo>
<a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"/></a><hr> <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
<a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a> <a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a>
</div> </div>
<div class=warning id=warning> <div class=warning id=warning>

View File

@ -0,0 +1,23 @@
HTTP/1.1 403 Access Denied
Content-Type: text/html; charset=UTF-8
Cache-control: no-cache
Connection: close
Proxy-Connection: close
<html><head>
<title>I2P Warning: Request Denied</title>
<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
</head>
<body>
<!-----------------------------
Let's not infinite loop here....
<div class=logo>
<a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
<a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a>
</div>
------------------------------>
<div class=warning id=warning>
<h3>Warning: Localhost Access</h3>
Your browser is misconfigured. Do not use the proxy to access the router console or other localhost destinations.
</div>

View File

@ -0,0 +1,21 @@
HTTP/1.1 503 Service Unavailable
Content-Type: text/html; charset=UTF-8
Cache-control: no-cache
Connection: close
Proxy-Connection: close
<html><head>
<title>I2P Warning: No outproxy configured</title>
<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
</head>
<body>
<div class=logo>
<a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
<a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a>
</div>
<div class=warning id=warning>
<h3>Warning: No Outproxy Configured</h3>
Your request was for a site outside of I2P, but you have no
HTTP outproxy configured. Please configure an outproxy in I2PTunnel.
</div>

View File

@ -0,0 +1,21 @@
HTTP/1.1 403 Bad Protocol
Content-Type: text/html; charset=UTF-8
Cache-control: no-cache
Connection: close
Proxy-Connection: close
<html><head>
<title>I2P Warning: Non-HTTP Protocol</title>
<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
</head>
<body>
<div class=logo>
<a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
<a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a>
</div>
<div class=warning id=warning>
<h3>Warning: Non-HTTP Protocol</h3>
The request uses a bad protocol.
The I2P HTTP Proxy supports http:// requests ONLY. Other protocols such as https:// and ftp:// are not allowed.
</div>

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 16; public final static long BUILD = 17;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;