Package net.i2p.router.web
Class RouterConsoleRunner
- java.lang.Object
-
- net.i2p.router.web.RouterConsoleRunner
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_LISTEN_PORTstatic StringENABLEDstatic StringJETTY_REALMstatic StringPREFIX(package private) static StringPROP_ALLOWED_HOSTSstatic StringPROP_CONSOLE_PWstatic StringPROP_DTG_ENABLEDstatic StringPROP_KEY_PASSWORDstatic StringPROP_KEYSTORE_PASSWORDstatic StringPROP_PW_ENABLEstatic StringROUTERCONSOLE(package private) static FileFilterWAR_FILTER
-
Constructor Summary
Constructors Constructor Description RouterConsoleRunner(RouterContext ctx, ClientAppManager mgr, String[] args)non-SSL: RouterConsoleRunner RouterConsoleRunner 7657 RouterConsoleRunner 7657 127.0.0.1 RouterConsoleRunner 7657 127.0.0.1,::1 RouterConsoleRunner 7657 127.0.0.1,::1 ./webapps/ SSL: RouterConsoleRunner -s 7657 RouterConsoleRunner -s 7657 127.0.0.1 RouterConsoleRunner -s 7657 127.0.0.1,::1 RouterConsoleRunner -s 7657 127.0.0.1,::1 ./webapps/ If using both, non-SSL must be first: RouterConsoleRunner 7657 127.0.0.1 -s 7667 RouterConsoleRunner 7657 127.0.0.1 -s 7667 127.0.0.1 RouterConsoleRunner 7657 127.0.0.1,::1 -s 7667 127.0.0.1,::1 RouterConsoleRunner 7657 127.0.0.1,::1 -s 7667 127.0.0.1,::1 ./webapps/
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) ServergetConsoleServer()To get to Jetty(package private) static ServergetConsoleServer(I2PAppContext ctx)To get to Jetty.StringgetDisplayName()The display name of the ClientApp, used in user interfaces.StringgetName()The generic name of the ClientApp, used for registration, e.g.ClientAppStategetState()The current state of the ClientApp.(package private) static voidinitialize(RouterContext ctx, WebAppContext context)Set up basic security constraints for the webapp.(package private) static booleanisSystrayEnabled(I2PAppContext context)Package private for ConfigServiceHandlerstatic StringjettyVersion()static voidmain(String[] args)voidshutdown(String[] args)Do not take a long time.voidstartConsole()http://irc.codehaus.org/display/JETTY/Porting+to+jetty6voidstartup()Do not take a long time.static voidstoreWebAppProperties(RouterContext ctx, Properties props)static PropertieswebAppProperties(String dir)static PropertieswebAppProperties(I2PAppContext ctx)
-
-
-
Field Detail
-
JETTY_REALM
public static final String JETTY_REALM
- See Also:
- Constant Field Values
-
PROP_CONSOLE_PW
public static final String PROP_CONSOLE_PW
- See Also:
- Constant Field Values
-
PROP_PW_ENABLE
public static final String PROP_PW_ENABLE
- See Also:
- Constant Field Values
-
ROUTERCONSOLE
public static final String ROUTERCONSOLE
- See Also:
- Constant Field Values
-
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
-
ENABLED
public static final String ENABLED
- See Also:
- Constant Field Values
-
PROP_KEYSTORE_PASSWORD
public static final String PROP_KEYSTORE_PASSWORD
- See Also:
- Constant Field Values
-
PROP_KEY_PASSWORD
public static final String PROP_KEY_PASSWORD
- See Also:
- Constant Field Values
-
DEFAULT_LISTEN_PORT
public static final int DEFAULT_LISTEN_PORT
- See Also:
- Constant Field Values
-
PROP_DTG_ENABLED
public static final String PROP_DTG_ENABLED
- See Also:
- Constant Field Values
-
PROP_ALLOWED_HOSTS
static final String PROP_ALLOWED_HOSTS
- See Also:
- Constant Field Values
-
WAR_FILTER
static final FileFilter WAR_FILTER
- Since:
- 0.9.34
-
-
Constructor Detail
-
RouterConsoleRunner
public RouterConsoleRunner(RouterContext ctx, ClientAppManager mgr, String[] args)
non-SSL: RouterConsoleRunner RouterConsoleRunner 7657 RouterConsoleRunner 7657 127.0.0.1 RouterConsoleRunner 7657 127.0.0.1,::1 RouterConsoleRunner 7657 127.0.0.1,::1 ./webapps/ SSL: RouterConsoleRunner -s 7657 RouterConsoleRunner -s 7657 127.0.0.1 RouterConsoleRunner -s 7657 127.0.0.1,::1 RouterConsoleRunner -s 7657 127.0.0.1,::1 ./webapps/ If using both, non-SSL must be first: RouterConsoleRunner 7657 127.0.0.1 -s 7667 RouterConsoleRunner 7657 127.0.0.1 -s 7667 127.0.0.1 RouterConsoleRunner 7657 127.0.0.1,::1 -s 7667 127.0.0.1,::1 RouterConsoleRunner 7657 127.0.0.1,::1 -s 7667 127.0.0.1,::1 ./webapps/
- Parameters:
args- second arg may be a comma-separated list of bind addresses, for example ::1,127.0.0.1 On XP, the other order (127.0.0.1,::1) fails the IPV6 bind, because 127.0.0.1 will bind ::1 also. But even though it's bound to both, we can't connect to [::1]:7657 for some reason. So the wise choice is ::1,127.0.0.1
-
-
Method Detail
-
main
public static void main(String[] args)
-
startup
public void startup()
Description copied from interface:ClientAppDo not take a long time. Do not block. Start threads here if necessary. Client must call ClientAppManager.notify() at least once within this method to change the state from INITIALIZED to something else. Will not be called multiple times on the same object.
-
shutdown
public void shutdown(String[] args)
Description copied from interface:ClientAppDo not take a long time. Do not block. Use a thread if necessary. If previously running, client must call ClientAppManager.notify() at least once within this method to change the state to STOPPING or STOPPED. May be called multiple times on the same object, in any state.
-
getState
public ClientAppState getState()
Description copied from interface:ClientAppThe current state of the ClientApp.
-
getName
public String getName()
Description copied from interface:ClientAppThe generic name of the ClientApp, used for registration, e.g. "console". Do not translate.
-
getDisplayName
public String getDisplayName()
Description copied from interface:ClientAppThe display name of the ClientApp, used in user interfaces. The app must translate.- Specified by:
getDisplayNamein interfaceClientApp- Returns:
- non-null
- Since:
- 0.9.4
-
getConsoleServer
Server getConsoleServer()
To get to Jetty- Returns:
- may be null or stopped perhaps
- Since:
- Jetty 6 since it doesn't have Server.getServers()
-
getConsoleServer
static Server getConsoleServer(I2PAppContext ctx)
To get to Jetty. Warning, this will NOT work during shutdown, because changeState(STOPPING) will unregister us first.- Returns:
- may be null or stopped perhaps
- Since:
- 0.9.38
-
jettyVersion
public static String jettyVersion()
- Since:
- 0.8.13, moved from LogsHelper in 0.9.33
-
isSystrayEnabled
static boolean isSystrayEnabled(I2PAppContext context)
Package private for ConfigServiceHandler- Since:
- 0.9.48 pulled out of startTrayApp
-
startConsole
public void startConsole()
http://irc.codehaus.org/display/JETTY/Porting+to+jetty6Server HandlerCollection HostCheckHandler (extends GzipHandler) ContextHandlerCollection LocaleWebAppHandler (routerconsole) SessionHandler SecurityHandler ServletHandler servlets... WebAppContext (i2psnark) WebAppContext (i2ptunnel) WebAppContext (imagegen) WebAppContext (susidns) WebAppContext (susimail) WebAppContext (for each plugin with a .war) DefaultHandler RequestLogHandler (opt)Porting to Jetty 9: http://dev.eclipse.org/mhonarc/lists/jetty-dev/msg01952.html You are missing a few facts about Jetty 9.1 ... First, there are no longer any blocking connectors. Its all async / nio connectors now. (mainly because that's the direction that the servlet api 3.1 is taking) Next, there is only 1 connector. The ServerConnector. However, it takes 1 or more ConnectionFactory implementations to know how to handle the incoming connection. We have factories for HTTP (0.9 thru 1.1), SPDY, SSL-http, and SSL-npn so far. This list of factories will expand as the future of connectivity to web servers is ever growing (think HTTP/2) Use the embedded examples for help understanding this. http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java?id=jetty-9.1.0.RC0
-
initialize
static void initialize(RouterContext ctx, WebAppContext context)
Set up basic security constraints for the webapp. Add all users and passwords.
-
webAppProperties
public static Properties webAppProperties(I2PAppContext ctx)
- Since:
- 0.9.4
-
webAppProperties
public static Properties webAppProperties(String dir)
-
storeWebAppProperties
public static void storeWebAppProperties(RouterContext ctx, Properties props)
-
-