All Implemented Interfaces:
Handler, HandlerContainer, Container, Destroyable, Dumpable, LifeCycle

public class XI2PLocationFilterextends HandlerWrapper
Adds a header, X-I2P-Location, to requests when they do **not** come in on an I2P hostname. This header contains a URL that looks like: [scheme://][i2phostname.i2p][/path][?query] and expresses the I2P-Equivalent URL of the clearnet query. Clients can use this to prompt users to switch from a non-I2P host to an I2P host or to redirect them automatically. It automatically enabled on the default I2P site located on port 7658 by default.
  • Field Details

    • PROP_ENABLE_LOCATION_HEADER

      private static final String PROP_ENABLE_LOCATION_HEADER
      Config key enabling the location header.
      See Also:
    • X_I2P_Location

      private String X_I2P_Location
      The cached header value.
    • lastFailure

      private long lastFailure
      When the last fetch failed.
    • failTimeout

      private static final long failTimeout
      Time before retrying after a failure.
      See Also:
    • _log

      private final Log _log
      The log for the filter.
  • Constructor Details

    • XI2PLocationFilter

      public XI2PLocationFilter()
      No location header prefix is cached and no failure is recorded; setLocation(String) picks the prefix up from the first request that carries one.
  • Method Details