rsrpc is a high-performance, drop-in replacement for arRPC written in Rust. It provides a Discord Rich Presence server with significantly lower resource usage, faster process detection, and dual protocol support.
- Drop-in arRPC Replacement: 100% compatible with arRPC's JSON interface (WebSocket port 1337).
- MessagePack Support: Optional secondary server on port 1338 using MessagePack for ~25% smaller payloads.
- Fast Process Detection: Uses
sysinfonative bindings (faster thanwmicsubprocess calls, doesn't spawn subprocesses). - Dual Transports: Supports both IPC (named pipes/unix sockets) and WebSocket (ports 6463-6472).
- Windows or Linux
- Rust and Cargo (for building from source)
Binaries: Grab the latest nightly binary from the Releases page. We provide builds for Windows (x64, arm64) and Linux (x64, arm64).
From Source:
git clone https://github.com/pog5/rsrpc.git
cd rsrpc
cargo build --release./rsrpc [OPTIONS]rsrpc can be configured via Command Line Arguments (flags) or Environment Variables. Flags take precedence.
| Flag | Env Variable | Default | Description |
|---|---|---|---|
--bridge-port <PORT> |
RSRPC_BRIDGE_PORT |
1337 |
Port for JSON bridge |
--msgpack-port <PORT> |
RSRPC_MSGPACK_PORT |
1338 |
Port for MessagePack bridge |
--enable-db-update |
RSRPC_ENABLE_DB_UPDATE |
false |
Enable startup DB fetch |
--no-process-scanning |
RSRPC_NO_PROCESS_SCANNING |
false |
Disable game detection |
--debug |
RSRPC_DEBUG |
false |
Enable verbose logging |
By default, rsrpc uses a bundled database of games for instant startup and zero network dependency. To enable runtime updates (fetching the latest list from Discord):
./rsrpc --enable-db-updatersrpc works out of the box with Vencord's WebRichPresence plugin due to its arRPC compatibility. Just enable the plugin and ensure rsrpc is running.
You can connect using standard WebSocket:
// Connect to standard JSON bridge
const ws = new WebSocket('ws://127.0.0.1:1337');
ws.onmessage = (msg) => console.log(JSON.parse(msg.data));Or use the optimized MessagePack interface (requires @msgpack/msgpack):
import { decode } from '@msgpack/msgpack';
const ws = new WebSocket('ws://127.0.0.1:1338?format=msgpack');
ws.binaryType = 'arraybuffer';
ws.onmessage = (msg) => console.log(decode(new Uint8Array(msg.data)));- Server: Orchestrates transports and process scanning.
- Transports:
- IPC: Handles local Discord client communication (
\\.\pipe\discord-ipc-0or/tmp/discord-ipc-0). - WebSocket: Mimics local Discord WebSocket server (ports 6463-6472).
- IPC: Handles local Discord client communication (
- Process Scanner: Periodically scans running processes against a local cache of
detectable.json. - Bridge: Broadcasts activity updates to connected web clients (e.g., Vencord).
| Feature | arRPC (Node.js) | rsrpc (Rust) |
|---|---|---|
| Memory Usage | 10GB. | 10MB |
| Executable Size | ~125MB (when bundled with Bun) | ~3 MB (Standalone, Windows) |
| Process Scan | powershell + wmic |
sysinfo |
| Protocols | JSON | JSON + MessagePack |
GPLv3 License. See LICENSE for details.