IRC chat bridge forbevy_chat
A headless async IRC client and event bridge for MUD and game clients — one ChatClient API across native tokio TCP and WASM WebSocket transports, with an optional Bevy plugin.
Dual transport, one API
The same ChatClient surface runs on native and in the browser — the transport is selected at compile time via cfg(target_arch).
- Native — tokio TCP (optionally TLS) to IRC on port 6667, or a WebSocket to the gateway.
- WASM — web_sys::WebSocket against a gateway such as wss://chat.kbve.com.
What it gives you
Features
Dual transport, one API
Native builds use tokio TCP to IRC on port 6667 (or a tungstenite WebSocket); WASM builds use web_sys::WebSocket against an IRC-over-WebSocket gateway (wss://chat.kbve.com). Selected at compile time via cfg(target_arch).
Identical public surface
ChatClient, connect, send, and subscribe / drain_incoming behave the same on both targets; game messages ride IRC PRIVMSG lines as [KIND] sender@platform: content with an optional JSON payload, and plain lines from ordinary IRC clients still arrive as chat.
Bevy plugin
Optional plugin feature — ChatPlugin bridges incoming IRC traffic into ECS events.
FFI surface
Optional ffi feature (native only) — a C-FFI layer for JNI and csbindgen consumers.
Get started
Usage
use bevy_chat::{ChatClient, IrcConfig};
let mut client = ChatClient::new(IrcConfig::default());
client.connect().await?;Questions
Frequently asked
What is the bevy_chat crate?
bevy_chat is a headless async IRC client that bridges chat and events for MUD and game clients. It exposes an identical public API across native tokio TCP and WASM WebSocket targets, with an optional Bevy plugin that forwards IRC traffic into ECS events.
How does bevy_chat pick a transport?
The target is chosen at compile time via cfg(target_arch). Native builds default to tokio TCP (optionally TLS) to an IRC server on port 6667, and can switch IrcConfig.transport to WebSocket to reach the same gateway the browser uses; WASM builds use web_sys::WebSocket against an IRC-over-WebSocket gateway such as wss://chat.kbve.com.
What optional features does bevy_chat offer?
The plugin feature adds a Bevy ChatPlugin that bridges IRC traffic into ECS events, and the ffi feature exposes a C-FFI surface for JNI and csbindgen consumers on native targets. The default build is the headless client with neither pulled in.
Discuss on the forum
Questions, fixes and notes on this page live in the KBVE forum.