forked from I2P_Developers/i2p.i2p
PortMapper: Status output for /debug
This commit is contained in:
@@ -38,6 +38,11 @@
|
|||||||
*/
|
*/
|
||||||
ctx.routerAppManager().renderStatusHTML(out);
|
ctx.routerAppManager().renderStatusHTML(out);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print out the status for the PortMapper
|
||||||
|
*/
|
||||||
|
ctx.portMapper().renderStatusHTML(out);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print out the status for all the SessionKeyManagers
|
* Print out the status for all the SessionKeyManagers
|
||||||
*/
|
*/
|
||||||
|
@@ -1,5 +1,10 @@
|
|||||||
package net.i2p.util;
|
package net.i2p.util;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.Writer;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import net.i2p.I2PAppContext;
|
import net.i2p.I2PAppContext;
|
||||||
@@ -73,4 +78,18 @@ public class PortMapper {
|
|||||||
return def;
|
return def;
|
||||||
return port.intValue();
|
return port.intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For debugging only
|
||||||
|
* @since 0.9.20
|
||||||
|
*/
|
||||||
|
public void renderStatusHTML(Writer out) throws IOException {
|
||||||
|
List<String> services = new ArrayList(_dir.keySet());
|
||||||
|
out.write("<h2>Port Mapper</h2><table><tr><th>Service<th>Port\n");
|
||||||
|
Collections.sort(services);
|
||||||
|
for (String s : services) {
|
||||||
|
out.write("<tr><td>" + s + "<td>" + _dir.get(s) + '\n');
|
||||||
|
}
|
||||||
|
out.write("</table>\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user