No description
Find a file
2026-05-02 07:44:41 -04:00
src add bridge command forwarding, mock oauth + scope tracking, split 2026-05-02 07:44:41 -04:00
.gitignore Initial commit 2026-05-01 18:32:14 -04:00
.gitlab-ci.yml Initial commit 2026-05-01 18:32:14 -04:00
Cargo.lock do some work with linux rpc, cn_proc makes it almost instant, no allow 2026-05-02 05:25:21 -04:00
Cargo.toml do some work with linux rpc, cn_proc makes it almost instant, no allow 2026-05-02 05:25:21 -04:00
detectable.json Initial commit 2026-05-01 18:32:14 -04:00
detectable_fixes.json Initial commit 2026-05-01 18:32:14 -04:00
LICENSE Initial commit 2026-05-01 18:32:14 -04:00
README.md add bridge command forwarding, mock oauth + scope tracking, split 2026-05-02 07:44:41 -04:00
rustfmt.toml Initial commit 2026-05-01 18:32:14 -04:00

rpcd

discord rpc daemon. rust port of arrpc-bun.

receives rich presence updates from local applications via discord ipc and a websocket transport, then re-broadcasts them to a bridge that a real discord client can connect to. also scans running processes against discord's detectable database to surface running games.

status

linux only.

windows ipc transport is not implemented.

macos has not been tested since the rewrite.

install

build from source with a recent rust toolchain:

cargo build --release
./target/release/rpcd

usage

rpcd [options]

flags and env vars are documented in rpcd --help.

short version:

  • rpcd runs in the foreground.
  • rpcd --update-database refreshes the detectable game database from discord and merges local fixes.
  • rpcd --list-database inspects the loaded database.
  • rpcd --list-detected shows what the process scanner is currently surfacing.

environment

see rpcd --help for the full list. common ones:

  • RPCD_DEBUG=1 enables debug logging. RUST_LOG is also respected.
  • RPCD_NO_PROCESS_SCANNING=1 disables the /proc scanner.
  • RPCD_DATA_DIR=/path overrides where detectable.json and detectable_fixes.json are read and written.
  • RPCD_DETECTABLE_FIXES_URL=<url> overrides the upstream fixes source used by --update-database.

bridge wire format

the bridge listens on RPCD_BRIDGE_PORT (default 1337) and broadcasts json messages to every connected client. two shapes:

activity events (untagged):

{ "activity": { ... }, "pid": 1234, "socketId": "..." }

bridge commands (tagged with a cmd field):

{ "cmd": "INVITE_BROWSER",            "data": { "code": "..." } }
{ "cmd": "GUILD_TEMPLATE_BROWSER",     "data": { "code": "..." } }
{ "cmd": "GIFT_CODE_BROWSER",          "data": { "code": "..." } }
{ "cmd": "DEEP_LINK",                  "data": { ... opaque ... } }
{ "cmd": "OPEN_EXTERNAL_LINK",         "data": { "url": "..." } }
{ "cmd": "OPEN_MESSAGE",               "data": { ... opaque ... } }
{ "cmd": "NAVIGATE_TO_CONNECTIONS",    "data": {} }
{ "cmd": "SEND_ACTIVITY_JOIN_INVITE",   "data": { "user_id": "..." } }
{ "cmd": "CLOSE_ACTIVITY_JOIN_REQUEST", "data": { "user_id": "..." } }

a bridge mod (the javascript injected into discord) should detect by checking for a cmd field; if present, dispatch the matching internal action; otherwise treat as an activity update.

license

bsd 3-clause. see the license file.