@velor/remote-mouse
v6.14.0
Published
Remote mouse and keyboard with mobile client
Readme
Remote Mouse
Le dossier de projet contient la vision, la roadmap globale et le suivi de développement par axe.
Remote Mouse is a web-based remote control for operating a computer from a phone, tablet, or another browser on the same network. The server exposes a mobile-friendly interface for mouse and keyboard control, browser shortcuts, admin actions, and optional Samsung TV remote commands.
Overview
The application includes:
- a token-based entry path with QR code access
- a mobile touchpad for mouse movement, clicking, and scrolling
- a keyboard panel for text input and special keys
- browser shortcut actions
- VLC media controls when VLC is available on the host
- admin actions from the client UI
- a server info page
- optional Samsung TV remote integration
Screenshots
Regenerate these assets with npm run screenshots:mobile.
| Remote control | Local preferences | | --- | --- | | | |
| VLC remote | Admin configuration | | --- | --- | | | |
| Server info | | --- | | |
Install
Automatic (preferred)
Linux installer:
curl -fsSL https://raw.githubusercontent.com/glennerichall/node-mouse/main/scripts/install-linux.sh | bashFor local development from this repository, run scripts/install-linux.sh:
scripts/install-linux.shUse -y to automatically accept every confirmation prompt:
scripts/install-linux.sh -yWhen running the installer through curl | bash, pass options after bash -s --:
curl -fsSL https://raw.githubusercontent.com/glennerichall/node-mouse/main/scripts/install-linux.sh | bash -s -- -yThe Linux installer is also the supported migration path for an existing
installation. It updates the npm package and missing uinput permissions while
preserving the existing .env, session secret, certificates and SQLite data.
Missing migration keys are appended idempotently. Use --overwrite-config
only when replacing the complete .env is intentional. After uinput is added
to an existing user, reconnect the desktop session before restarting the user
service.
Windows installer:
powershell -ExecutionPolicy Bypass -File scripts/install-windows.ps1Use -Yes to automatically accept every confirmation prompt:
powershell -ExecutionPolicy Bypass -File scripts/install-windows.ps1 -YesFor a downloaded script:
iwr https://raw.githubusercontent.com/glennerichall/node-mouse/main/scripts/install-windows.ps1 -OutFile install-windows.ps1
powershell -ExecutionPolicy Bypass -File .\install-windows.ps1Downloaded script with automatic confirmations:
iwr https://raw.githubusercontent.com/glennerichall/node-mouse/main/scripts/install-windows.ps1 -OutFile install-windows.ps1
powershell -ExecutionPolicy Bypass -File .\install-windows.ps1 -YesmacOS installer scripts will be added later.
Session cookie secret
The Linux and Windows installers generate a unique 32-byte random
SESSION_COOKIE_SECRET in the configuration .env file. Production startup
refuses the default change-me value and secrets shorter than 64 characters.
For a manual production setup, generate a secret with
openssl rand -hex 32 and keep it private; never include it in logs or support
reports.
To rotate the secret, replace SESSION_COOKIE_SECRET in the configuration
.env with a newly generated value and restart Remote Mouse. Existing browser
session cookies will no longer be valid, so connected clients must establish a
new session. Back up the configuration file securely before editing it, and do
not reuse the previous secret.
The automatic installer is expected to handle:
- Node.js installation or validation
- platform native dependencies
- npm package installation
- initial
.envcreation - optional local service installation
- first-run access URL and QR code display
Custom
Use the custom installation path when you want to install each dependency yourself, run from source, or tune the host service manually.
Node.js
Install an active Node.js LTS release before installing Remote Mouse. The application uses npm scripts and native Node.js modules, so both node and npm must be available in your terminal.
Linux and macOS
Using nvm is recommended because it keeps the Node.js version isolated from the system packages:
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
nvm install --lts
nvm use --ltsRestart your terminal if nvm is not available immediately after installation.
Windows
Install the Node.js LTS release from the official installer, or use winget:
winget install OpenJS.NodeJS.LTSOpen a new terminal after installation so node and npm are available in PATH.
Verify
node --version
npm --versionPlatform Dependencies
This project uses RobotJS on X11, Windows and macOS. On Linux Wayland it uses an
in-process C Node-API bridge to /dev/uinput by default. The isolated XDG
RemoteDesktop/libei helper is kept as an optional strategy when
compositor-managed consent is preferred.
VLC media player is optional. Install it on the host machine if you want the VLC remote to appear and control media playback.
Linux
Typical Debian or Ubuntu packages:
sudo apt-get update
sudo apt-get install -y build-essential libx11-dev libxtst-dev libpng++-dev wmctrl yadFor Wayland development, build the default uinput bridge and grant only the
desktop user access to /dev/uinput:
npm run build:uinput
sudo scripts/configure-uinput-access.sh "$USER"Reconnect the desktop session after creating the dedicated group. Do not add
the user to the general input group. To use the optional portal strategy,
install pkg-config libei-dev liboeffis-dev, run npm run build:wayland, and
set REMOTE_MOUSE_WAYLAND_INPUT=portal.
Notes:
libx11-dev,libxtst-dev, andlibpng++-devare required for the native mouse and keyboard integrationwmctrlis used for browser focus and window activation on Linuxyadis used for the Linux QR overlay- X11 uses RobotJS; Wayland uses uinput without a system consent dialog. Remote Mouse authentication remains responsible for authorizing remote commands
- with
REMOTE_MOUSE_WAYLAND_INPUT=portal, an interactive start opens the local Remote Desktop dialog; for a service, runremote-mouse wayland authorize - Wayland preview is not yet available; it remains disabled until the PipeWire capture adapter is implemented
Windows
Typical requirements:
- Microsoft Visual Studio C++ Build Tools for native Node modules
- Python available in
PATHif native module compilation is needed - PowerShell and Windows Forms support for the QR overlay behavior
Notes:
- the Windows QR overlay uses PowerShell with Windows Forms
- depending on your environment,
npm installmay use a prebuilt binary or may require local native compilation
Package Install
Install the published npm package globally:
npm install -g @velor/remote-mouse
remote-mouseOn startup, the server prints the client access URL and the corresponding QR code.
Source Install
Use this path when working from a checked-out repository:
npm install
npm startOn startup, the server prints the client access URL and the corresponding QR code.
Self-Signed HTTPS Certificate
HTTPS can be enabled with a local self-signed certificate. This is useful when a browser feature or deployment context requires a secure origin.
Create a local certificate directory:
mkdir -p certsGenerate a self-signed certificate:
openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes \
-keyout certs/remote-mouse.key \
-out certs/remote-mouse.crt \
-subj "/CN=remote-mouse.local" \
-addext "subjectAltName=DNS:localhost,DNS:remote-mouse.local,IP:127.0.0.1"Enable HTTPS in .env:
HTTPS=true
SSL_KEY_PATH=certs/remote-mouse.key
SSL_CERT_PATH=certs/remote-mouse.crtBrowsers will warn about self-signed certificates until the certificate is trusted locally. This is expected for a local self-signed certificate. Open the advanced/details option in the browser warning and choose to continue to the site.
Linux Deployment
The application can manage its own systemd --user service.
Typical setup:
- Install the package with npm, or use the source install path above.
- Create a
.envfile based on.env.example. - Run
remote-mouse service install. - Use
remote-mouse service restart,remote-mouse service disable, orremote-mouse service uninstallas needed.
The generated unit is equivalent to the following:
[Unit]
Description=Remote Mouse Server
After=graphical-session.target network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/path/to/remote-mouse/bin/remote-mouse.js
Restart=on-failure
RestartSec=2
Environment=PATH=/path/to/nodejs:/usr/local/bin:/usr/bin:/bin
Environment=NODE_ENV=production
PassEnvironment=DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
[Install]
WantedBy=default.targetDepending on the graphical environment, passing the user session environment may be necessary for UI-related integrations.
X11 control continues through RobotJS. Under Wayland, mouse and keyboard input
use uinput by default, independently of the desktop portal backend. The portal
implementation remains selectable with REMOTE_MOUSE_WAYLAND_INPUT=portal.
Cursor preview is still disabled under Wayland to prevent the native
X_GetImage failure; native capture remains planned through ScreenCast and
PipeWire.
Windows Deployment
On Windows, the application manages a Task Scheduler entry that runs at user logon.
Typical setup:
- Install the package with npm, or use the source install path above.
- Create a
.envfile based on.env.example. - Run
remote-mouse service install. - Use
remote-mouse service restart,remote-mouse service disable, orremote-mouse service uninstallas needed.
The generated scheduled task follows this model:
- Trigger:
At log on - Action:
schtasks /Create - Task name: the configured
serviceName - Command: launches the
remote-mouseentrypoint withREMOTE_MOUSE_DAEMON=1 - Run only when the user is logged on
Notes:
- running in a user session is usually preferable because mouse, keyboard, browser, and overlay integrations depend on an interactive desktop session
- if you rely on the QR overlay or browser-opening actions, make sure the task runs in the same desktop session as the logged-in user
- if you installed the app globally, the generated task uses the
remote-mouseCLI entrypoint directly
Configuration
Startup configuration is handled through a .env file. Instead of duplicating every environment variable here, use .env.example as the reference.
Reverse proxy
Forwarded client addresses are ignored by default. When Remote Mouse runs behind
a reverse proxy, set TRUST_PROXY to the proxy IP or subnet (multiple values are
comma-separated). For a proxy on the same machine, use TRUST_PROXY=loopback.
The proxy must replace, rather than append to, client-supplied forwarding headers.
Never trust a subnet containing untrusted clients: a trusted proxy can affect the
localhost authentication bypass as well as the address recorded for sessions.
Same-origin browser requests are allowed by default. If a separately hosted PWA
needs to call this server, set ALLOWED_ORIGINS to its exact origin (or a
comma-separated list of exact origins), including the scheme and port when
non-default. Wildcard origins are not supported; this setting permits credentialed
browser requests and should only contain trusted origins. It does not yet change
the session cookie's SameSite policy, so a separately hosted cross-site PWA
still needs the dedicated cookie/deployment work planned for the PWA milestone.
Access and Administration
Paired devices start with the controller role. To allow temporary remote
administration, set a password of at least 12 characters in the server .env:
ADMIN_PASSWORD=replace-with-a-long-unique-password
ADMIN_UNLOCK_MINUTES=15Restart the service after changing the file. A password field then appears in the left drawer. A successful unlock elevates only the current paired session, expires automatically, and is cleared by a server restart. Prefer HTTPS before entering this password over a network.
Useful server pages:
/qrdisplays the entry QR code/ui/admin/server-infoshows server state, effective configuration, and recent logs/ui/admin/configlets you edit persisted settings grouped to match the configuration object structure
Useful CLI commands:
helpdisplays the available CLI commandsinfoprints the server capabilitiesconfigprints the effective persisted configurationconfig get <path>prints one persisted configuration valueconfig set <path> <value>updates one persisted configuration valuesys-configprints the system configurationsystem-configis an alias ofsys-configservice installinstalls the local daemon/serviceservice disabledisables the local daemon/serviceservice uninstalluninstalls the local daemon/serviceservice restartrestarts the local daemon/servicetasksprints the task manager snapshottask-manageris an alias oftasksupdate-eventsprints persisted update-manager eventssamsung-detectdetects Samsung TVs available on the networktokenslists persisted entry tokensopen-qropens the QR page on the serverqris an alias ofopen-qr
Example:
remote-mouse config get logging.level
Routes
The server exposes two main HTTP surfaces:
- UI routes for HTML pages
- API routes for JSON and SSE
UI Routes
GET /serves the client applicationGET /qrdisplays the entry QR code pageGET /ui/admin/server-infoserves the server info pageGET /ui/admin/configserves the admin configuration page
Session Route
GET /api/sessions/:tokenvalidates an entry token, creates the signed session cookie, and redirects to/
Admin API Routes
GET /api/admin/server-info/datareturns the current server snapshot: version, uptime, connected clients, tasks, tokens, effective config, system config, and recent logsGET /api/admin/configsreturns the managed configuration entries, schema, defaults, and managed pathsGET /api/admin/configs/:configIdreturns one managed configuration entryPATCH /api/admin/configs/:configIdupdates one managed configuration entryDELETE /api/admin/configs/:configIdresets one managed configuration entry to its default valuePOST /api/admin/subs/configscreates a config SSE subscription and returns its id plus the stream URLGET /api/admin/subs/:idopens the SSE stream for a previously created subscriptionDELETE /api/admin/subs/:iddeletes a previously created subscriptionPOST /api/admin/restart-servicerequests a local service restart through the application daemon service
Client API Routes
Authenticated controller sessions use a read-only API surface that does not expose administrative configuration:
GET /api/client/configreturns the functional configuration required by the remoteGET /api/client/remotesreturns the available remote controlsGET /api/client/remotes/browsersreturns available browser launchersPOST /api/client/subs/configscreates a filtered client configuration subscriptionGET /api/client/subs/:idopens its SSE streamDELETE /api/client/subs/:iddeletes the subscription
Health Route
GET /healthreturns a simple health payload with the current application version
Static Assets
After session validation, static assets are also available through:
/client/*/utils/shared/*- files served from
public/
Notes
- client access is controlled by either a generated token path or a fixed entry path, depending on configuration
- HTTPS can be enabled when required by the deployment context
- Samsung TV integration is optional and disabled by default
