java.lang.Object
org.klomp.snark.standalone.RunStandalone
Standalone runner for I2PSnark.
Launches an embedded Jetty server hosting the I2PSnark web interface independently of the main I2P router. Reads configuration from jetty-i2psnark.xml and i2psnark-appctx.config, parses host/port from the Jetty XML config, and optionally opens the system browser.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final I2PAppContextThe context the standalone app runs in.private StringAddress the server listens on.private static RunStandaloneThe one running instance.private final JettyStartThe web server hosting the torrent page.private intPort the server listens on.(package private) static final FileThe app context config file name.Constructor Summary
ConstructorsModifierConstructorDescriptionprivateRunStandalone(String[] args) Parses the command line and starts the server.Method Summary
Modifier and TypeMethodDescriptionThe host from the Jetty config.intThe port from the Jetty config.The snark revision.static voidEntry point for standalone I2PSnark.static voidshutdown()Shut the embedded Jetty server down and exit, if this class has an instance.voidstart()Starts the standalone I2PSnark server and optionally opens the system browser.voidstop()Stops the embedded Jetty server.
Field Details
_jettyStart
The web server hosting the torrent page._context
The context the standalone app runs in._host
Address the server listens on._port
private int _portPort the server listens on._instance
The one running instance.APP_CONFIG_FILE
The app context config file name.
Constructor Details
RunStandalone
Method Details
main
Entry point for standalone I2PSnark.- Parameters:
args- args[0] host, args[1] port
start
public void start()Starts the standalone I2PSnark server and optionally opens the system browser.stop
public void stop()Stops the embedded Jetty server.shutdown
public static void shutdown()Shut the embedded Jetty server down and exit, if this class has an instance.getSnarkRevision
getHostFromJettyConfig
The host from the Jetty config.- Returns:
- the host from jetty config
getPortFromJettyConfig
public int getPortFromJettyConfig()The port from the Jetty config.- Returns:
- the port from jetty config