Polyrhoé (PRH or pr), from the Greek πολύς (many) and ῥοή (flow), is a protocol operating over TCP/IP for multiplexing simultaneous shell connections to multiple remote hosts.
Refer to the iroh branch for PR using Iroh instead of TCP/IP. I recommend using the Iroh implementation for a more modern and efficient experience.
Due to complications in a previous collaborative project for YH4F 2025 and the time constraints of my final exams, I had to start a completely new project within a tight timeframe of about ten days. The following roadmap outlines its current structure and objectives.
- Client operational
- Server operational
- Fully encrypted communications with DH and AES-GCM
- Multiplexing of multiple connections
- User-friendly client interface
- Multithreading for the different connections
- Support for multiple client connections
- Modern CLI
- Documentation
- Tags support
- Add tags to connections
- Command dispatch by tag
- Iroh implementation
- Authentication support
- Password-based authentication
- Whitelist of trusted IP addresses
- Macro support
- Per-machine variable substitution in commands (e.g.
{{ip}}) - Define macros with variables
- Execute macros on multiple machines
- Per-machine variable substitution in commands (e.g.
- Diffing support
- Daemon mode for the server
- as a systemd service
- Errors and logs management
- Command history
You need to have rustc and cargo installed on your system. If you're using Nix, you can directly enter
nix develop
Else, you can install them by following the instructions on the official Rust website.
Once you have dependencies installed, clone the project :
git clone https://github.com/lokasku/pr.git wherever/you/want
cd wherever/you/want/prTo start the client, run the following command at the root of the repository :
cargo run --release --package pr-clientThen, an interactive interface will be displayed, allowing you to :
- A or a : Add a connection to a remote host
- L or l : List all established connections
- R or r : Remove a connection
- S or s : Switch to a connection
- M or m : Modify a connection
- N or n : Change the name of a connection
- A or a : Add tags to a connection
- R or R : Remove tags from a connection
- B or b : Go back to the menu
- D or d : Dispatch a command given tags
- Enter the tags to dispatch the command to, separated by commas (e.g.
tag1,tag2) - Enter the command to execute on the selected connections
- Enter the tags to dispatch the command to, separated by commas (e.g.
- Q or q : Exit the client
When you switch to a connection, enter the % to come back the main menu. The connection will remain active in the background, allowing you to switch back to it at any time.
To start the server, run :
cargo run --release --package pr-server -- -p 1789By default, the server will listen on port 1736 but you can specify a different port using the -p option.
However, in order to connect to a remote machine, the open port must be configured on the router so that it can be accessed remotely. You can still use the server locally for testing purposes.
First, start the server in one terminal :
cargo run --release --package pr-serverThen, in another terminal, start the client :
cargo run --release --package pr-clientFinally, add a connection with A or a and enter localhost as the address and 1736 as the port. You can then switch to this connection and execute commands on it. You are free to add as many connections as you want.
For detailed technical documentation, including protocol specifications please refer to the docs/ directory.
I extend my sincere thanks to CoCoSol for his valuable support during the final phase of practical testing.
PR is licensed under the MPL-2.0 (Mozilla Public License 2.0). See the LICENSE file for mode details.