Portway
Use a phone as a mouse and keyboard for a Linux machine. Portway serves the controller over the local network and sends input through /dev/uinput.
source on GitHubWhat it does
Portway runs a small server on a Linux machine and serves its own phone controller. After pairing, the browser sends pointer and keyboard events over a WebSocket. Portway turns those messages into kernel input events through /dev/uinput; it does not need an X11 or Wayland-specific input API.
- One-finger movement, tap, double-click, two-finger scrolling, right-click, and click-and-drag.
- Left, middle, and right mouse buttons with press-and-hold.
- US-ASCII text, sticky modifiers, navigation keys, F1–F12, and common media keys.
- Held keys and buttons are released after disconnects, inactivity, hidden pages, and clean server shutdown.
Install
The installer is intended for conventional systemd distributions. It creates an unprivileged service account, configures access to /dev/uinput, and enables Portway at boot.
git clone https://github.com/heptanal/portway.git
cd portway
cargo build --release --locked
scripts/install-linuxNixOS users can use the package and NixOS module included in the repository instead of the installer.
Pairing and security
Portway listens on 0.0.0.0:2721 by default. That makes it reachable from the LAN, but potentially from any other network attached to the host as well. Authentication is required by default; plain HTTP still leaves pairing codes and input unencrypted.
Use it on a trusted network, restrict the port to the intended interface, or configure HTTPS. The normal service should not run as root. Access to /dev/uinput is enough to synthesize input and should be treated accordingly.
Limits
- Text entry is printable US-ASCII, newline, and tab. It is not arbitrary Unicode or a general keyboard-layout mapper.
- Compositors, display managers, and login screens decide whether to accept virtual input devices.
- Portway cannot wake a suspended machine, repair its network, or make a disconnected host reachable.
- HTTP should be limited to a trusted network. Use HTTPS when the traffic needs protection in transit.