Hoy! - TUI real-time messaging app
A TUI real time messaging app inspired by accord.
Index
Installation
Install using cargo:
Usage
Both the server and client currently share the same binary hoy:
)
Starting the server
Run in server mode with the -s flag. The default port is 7777.
# Start on default port 7777
# Start on a custom port
Connecting a client
Connect as a client by providing a username with -u. The client connects to
127.0.0.1 on the specified port (default 7777).
# Connect with username "alice" to default port
# Connect to a custom port
On connection, the server places the client in #general and broadcasts a join
message to all connected clients.
Chat commands
Once connected, type in the terminal. Plain text sends a chat message. Special
commands begin with /:
| Command | Action |
|---|---|
/list |
Requests a list of available rooms |
/room <room name> |
Requests joining/creating a room |
/ping |
Send a heartbeat ping; server replies Pong. |
/disconnect |
Disconnect from the server without exiting. |
/quit |
Disconnect and exit the client. |
/exit |
Alias for /quit. |
Any other input is sent as a chat message and broadcast to all clients in the room.
Valid room name:
- Allowed characters: lowercase ASCII letters, Ascii digits,
_,- - Length: 1-64 characters.
Crates
hoy-core- Shared domain logichoy-net- Networking layerhoy-protocol- Wire level protocol defining packets and codechoy-tui- App TUI
Protocol
The wire protocol is useful for contributors or anyone building alternative clients.
Frame format
Each packet is encoded as a length-prefixed frame:
[4 bytes: big-endian u32 payload length][N bytes: JSON payload]
The JSON payload is a serialized ClientPacket or ServerPacket enum value.
There is no framing delimiter; frames are concatenated directly in the TCP
stream.
Client packets and server packets
See hoy-protocol readme.
Similar projects
License
This project is licensed under either of:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed under the Apache-2.0 and MIT license, without any additional terms or conditions.
Development
TLDR:
Requires just to bootstrap all tools and configuration
To run:
To test:
Before committing work:
To see all available commands: