public class EepGetNamingServiceextends DummyNamingService
A network-based naming service using HTTP, with in-memory caching. Fetches from one or more remote (in-i2p) CGI services using HTTP GET.

The remote HTTP service takes a CGI parameter and must return (only) the 516-byte Base64 destination, or hostname=dest. A trailing \n or \r\n is acceptable.

Should be used from MetaNamingService, after HostsTxtNamingService. Cannot be used as the only NamingService! Be sure any naming service hosts are in hosts.txt. Supports caching, b32, and b64.

Sample config to put in configadvanced.jsp (restart required):

i2p.naming.impl=net.i2p.client.naming.MetaNamingService i2p.nameservicelist=net.i2p.client.naming.HostsTxtNamingService,net.i2p.client.naming.EepGetNamingService i2p.naming.eepget.list=http://namingservice.i2p/cgi-bin/lkup.cgi?host=,http://i2host.i2p/cgi-bin/i2hostquery?

  • Field Details

    • PROP_EEPGET_LIST

      private static final String PROP_EEPGET_LIST
      Property listing the naming sites to query.
      See Also:
    • DEFAULT_EEPGET_LIST

      private static final String DEFAULT_EEPGET_LIST
      The naming sites queried when the property is unset.
      See Also:
    • VALID_DEST_CHARS

      private static final Pattern VALID_DEST_CHARS
      Characters allowed in a name being looked up.
    • MAX_RESPONSE

      private static final int MAX_RESPONSE
      Largest response accepted for a destination, allowing for the headers.
      See Also:
  • Constructor Details

    • EepGetNamingService

      public EepGetNamingService(I2PAppContext context)
      The naming service should only be constructed and accessed through the application context. This constructor should only be used by the appropriate application context itself.
      Parameters:
      context - the application context
  • Method Details

    • getURLs

      private List<String> getURLs()
      Reads the naming sites from the config.
      Returns:
      the sites to try, in order
    • lookup

      public Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions)
      Description copied from class: DummyNamingService
      Throws, this service knows no destinations.
      Overrides:
      lookup in class DummyNamingService
      Parameters:
      hostname - mixed case as it could be a key
      lookupOptions - input parameter, NamingService-specific, can be null
      storedOptions - output parameter, NamingService-specific, any stored properties will be added if non-null
      Returns:
      dest or null
    • fetchAddr

      private String fetchAddr(String url, String hostname)
      Fetches one destination from a naming site.
      Parameters:
      url - the site's query URL
      hostname - the name being looked up
      Returns:
      the destination, null if the site has none