Skip to main content

The proximamp service: tunnels that survive a reboot

Install the proximamp service: it opens the tunnels from a proximamp.yml file when the computer starts, even with nobody signed in to the system, and restarts by itself after a crash. It needs administrator rights: sudo on Linux, a terminal opened as administrator on Windows.

Install the service​

  1. Describe the tunnels in a proximamp.yml file. The service is a separate device of your account with its own memory of addresses: to have it open a tunnel on an address you already have, put that address in address: and stop the command that holds it now.

  2. Install the service (on Windows without sudo, after you cd to the folder with proximamp.yml and key.txt):

    sudo proximamp service install -c proximamp.yml
    sudo proximamp service install -c proximamp.yml --key-stdin < key.txt # or with a device key

    In PowerShell, give the key from a file like this:

    Get-Content key.txt | proximamp service install -c proximamp.yml --key-stdin

    The first command asks for your ProximaMP login and password once: the sign-in is kept by the service, not by you. The second connects the service with a device key. The service has no sign-in through VK ID, Yandex ID or a phone: if the account has no password, connect it with a key or set a password in the app (ways to sign in) or with the command on a computer with a browser:

    proximamp password set

    If sudo answers sudo: proximamp: command not found (as on RHEL, AlmaLinux, Rocky Linux and Oracle Linux, and with Node.js from nvm or fnm), type sudo env "PATH=$PATH" proximamp instead of sudo proximamp here and in the other service commands, for example:

    sudo env "PATH=$PATH" proximamp service install -c proximamp.yml

Without a terminal, for example in a script, pass the password through --password-stdin (the password in the variable PASS, your login instead of alice):

printf '%s\n' "$PASS" | sudo proximamp service install alice -c proximamp.yml --password-stdin

In PowerShell, in an administrator terminal:

$env:PASS | proximamp service install alice -c proximamp.yml --password-stdin

Change, sign in again, remove​

To change the service's tunnels or close one of them, edit proximamp.yml and install the service again:

sudo proximamp service install -c proximamp.yml

The rest:

sudo proximamp service login # the service's sign-in expired
sudo proximamp service inspect # requests to the service's http link
sudo proximamp service access <address> # protection of a tunnel of the service
sudo proximamp service uninstall # remove the service

The install names an error in proximamp.yml before it changes anything. In your own proximamp ls the service's tunnels show as "elsewhere", and proximamp close doesn't close them. proximamp service access changes their protection, with the same words as proximamp access and an address from sudo proximamp service status. The service's inspector is the same as the command's, but it only prints the link to the page: open it yourself. A removed service signs out, and its sign-in and memory of addresses are deleted. To move the service to another account, remove it and install it again.

If ProximaMP refuses one of the service's tunnels (for example, when the account already holds as many addresses as the plan allows), the service keeps running: its log says what to do, and the service tries that tunnel again by itself, up to every 5 minutes.

Where the service is​

  • Linux: the systemd service proximamp, run by the system user proximamp-cli without root rights. The service's log:

    sudo journalctl -u proximamp

    On a system without systemd, such as WSL where it isn't turned on, the service doesn't install: "this system has no systemd: proximamp service needs it". In WSL, turn systemd on with Microsoft's guide.

  • Windows: the service proximamp, run by the account NT SERVICE\proximamp without administrator rights. Its config, sign-in and log are in C:\ProgramData\proximamp. The log's last lines, in an administrator terminal:

    Get-Content C:\ProgramData\proximamp\logs\proximamp.log -Tail 50

The service runs on its own copy of the program. How to move it to a new version is on the page "How to update proximamp".

Check​

Reboot the computer and look at the service's state:

sudo proximamp service status

The service is running, and every tunnel from the file has an address.