kernl API
    Preparing search index...

    Function createDownloadClients

    • The person's download connections, and the routing the torrent, nzb and soulseek services read (D-050, D-053). A person may set up any number of connections, several of the same program among them; each has a random id and a label of their own.

      Addresses, usernames and labels are kept on this device at kernl:download-programs:v1. Passwords and keys are not: they go to the secrets provider under download:<connection id>:password and …:apiKey, and are held in memory only for the clients that sign in with them, so nothing that reads settings, the settings form included, is ever handed one (D-052). A connection serves nobody until the provider has answered for its kept sign-in, and none whose sign-in the provider will not hand over (it is locked).

      An address is checked against how kernl itself is served before it is kept or used: a page loaded over https may call a plain http address only on this device, so anything else is refused as invalid:mixed-content. An address typed without a scheme has it worked out by asking the program, https first. What comes back out of storage is checked again and dropped when it no longer passes.

      Parameters

      • options: DownloadClientsOptions

        Storage, and optionally the secrets provider, how the page was loaded and the fetch to use.

      Returns DownloadClients

      The settings and the routing built from them.

      const programs = createDownloadClients({ storage: localStorage });
      const { signIn } = await programs.check('transmission', { url: 'localhost:9091', username: 'me', password: 'secret' });
      const home = await programs.add('transmission', signIn, 'Home');
      await programs.routing('torrent').byId(home.id)?.client.list();