Remote njMule
The desktop app can show and drive another njMule: one running headless on a NAS, in Docker or as a Windows service, or on another computer. It opens a window of its own on that njMule, with the same screens as for your own, and talks to it through its remote-control API with a token. Your own njMule, if it runs, goes on beside it.
Before you start
On the computer you want to reach:
-
Turn on its web interface, and with it the API: in the desktop app, turn on Answer the remote-control API too (njmule --remote; callers need its token) in the Web interface options; headless, start it with
--webui-api(see Remote control). To reach it from another computer, turn on Let other computers connect (otherwise only this one) too. -
Get its token: Copy the API token in the same options, or run:
njmule --api-token
The token gives full control of that njMule: keep it as you would a password. New API token, or
njmule --new-api-token, replaces it, and the old one stops working.
Connecting from the menu
- Choose ⋯ → Connect to a remote njMule.
- Type the Address of its web interface, such as
http://nas.local:4711/api/v1. A shorter form works too:nas.local:4711becomeshttp://nas.local:4711/api/v1. The list offers the connections remembered. - Paste the API token.
- Leave Remember this connection on this computer ticked to keep the address and the token for next time.
- Press Connect.
njMule first tries the address and the token: if the other njMule does not answer or refuses the
token, the dialog says Cannot connect: … and stays open. Otherwise a new njMule window opens on
the other computer's njMule, its address in the title bar (as njMule 0.1.0 - nas.local:4711).
The new window is a second start of the desktop app, njmule-gui with --remote-url, which starts
no engine of its own.
Connecting from the command line
njmule-gui --remote-url opens the desktop app directly on another njMule. The token comes from the
NJMULE_API_TOKEN environment variable or, without it, from a connection remembered for that address.
- Windows
- macOS
- Linux
$env:NJMULE_API_TOKEN = "<the token>"
njmule-gui --remote-url http://nas.local:4711/api/v1
NJMULE_API_TOKEN="<the token>" njmule-gui --remote-url http://nas.local:4711/api/v1
NJMULE_API_TOKEN="<the token>" njmule-gui --remote-url http://nas.local:4711/api/v1
The address must be a full http:// or https:// address of the API. Without a token the window
does not open, and tells you to set NJMULE_API_TOKEN or connect from the menu.
Remembered connections
The connections you ask njMule to remember are kept, address and token, in remotes.properties in
the gui folder of your profile (see Data locations). On Linux and macOS
only your user can read the file; on Windows it lies in your own profile folder. Remove a line of it
to forget that connection.
What works remotely
Almost everything works as with your own njMule, on the other one: transfers, searches (and the search tabs kept for its next start), shared files, messages and friends, the network, the statistics, the options, the scheduler, the categories and the updates of the other njMule. What only this computer can do does not work:
| What | What happens |
|---|---|
| Preview | Greyed out, as the data of the download stays on the other computer. |
| Opening files and folders | Open Folder and Open Incoming Folder are greyed out or tell that the folders of the other njMule are on its own computer, as opening a completed download does. |
| Choosing a folder | As in the web interface, a path of the other computer is typed: Browse... is greyed out beside a category's folder, the options' folders and command lines and the import's eMule folder, and Share a folder asks for the path in its question. A sound or a player of this computer is still chosen with Browse.... |
| That computer's system | Start njMule when I log in, Open ed2k links with njMule and the web interface's settings are greyed out; an import from eMule does not turn on the start at login there either. |
Add servers from server.met... and Add contacts from nodes.dat... take a file of this computer and send it to the other njMule.
What belongs to this computer stays local: the look and language of the window, the desktop app's own options (start minimised, the notification area, the question on exit, the clipboard), and the links clicked in your browser, which go to your own njMule. The window writes no log of its own: the other njMule logs on its computer.