Skip to content

RPC support#1464

Draft
valzargaming wants to merge 1 commit intomasterfrom
RPC
Draft

RPC support#1464
valzargaming wants to merge 1 commit intomasterfrom
RPC

Conversation

@valzargaming
Copy link
Copy Markdown
Member

This pull request introduces cross-platform support for connecting to Discord's IPC (Inter-Process Communication) using ReactPHP, with special handling for Windows named pipes. It adds a new example demonstrating asynchronous IPC usage, and introduces a flexible connector factory and a Windows-specific connector placeholder that guides users on enabling Windows support.

New Example and Platform Connector Abstraction:

  • Added a new asynchronous example script (examples/rpc_ipc.php) that demonstrates connecting to Discord IPC using ReactPHP, handling events, and managing responses with timeouts.
  • Introduced ConnectorFactory to abstract platform-specific connector creation, returning a React\Socket\Connector on Unix-like systems and a WindowsPipeConnector or null on Windows depending on support.

Windows Named-Pipe Support and Guidance:

  • Added WindowsPipeConnector, a placeholder connector that provides actionable error messages if async named-pipe support is not yet available. It supports connecting via a TCP proxy (DISCORD_IPC_TCP_PROXY) or spawning a helper process (DISCORD_IPC_PROXY) to bridge named pipes, and otherwise clearly instructs users how to enable support.

@valzargaming
Copy link
Copy Markdown
Member Author

valzargaming commented Apr 4, 2026

This is an early-stage proof of concept and shouldn’t be merged.

I can't meaningfully test this in its current state as I do not have readily available access to my only bot that uses oauth2. I'm leaving this PR here as a draft to invite a discussion on what such an implementation could or should look like, with the expectation that a future implementation should be developed in a separate repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant