java.lang.Object
org.klomp.snark.standalone.RunStandalone

public class RunStandaloneextends Object
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 Details

    • _jettyStart

      private final JettyStart _jettyStart
      The web server hosting the torrent page.
    • _context

      private final I2PAppContext _context
      The context the standalone app runs in.
    • _host

      private String _host
      Address the server listens on.
    • _port

      private int _port
      Port the server listens on.
    • _instance

      private static RunStandalone _instance
      The one running instance.
    • APP_CONFIG_FILE

      static final File APP_CONFIG_FILE
      The app context config file name.
  • Constructor Details

    • RunStandalone

      private RunStandalone(String[] args) throws Exception
      Parses the command line and starts the server.
      Parameters:
      args - the command line arguments
      Throws:
      Exception - if the server cannot start
  • Method Details

    • main

      public static void main(String[] args)
      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

      public String getSnarkRevision()
      The snark revision.
      Returns:
      the version string of this build
    • getHostFromJettyConfig

      public String 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