Skip to content
crates · rust · bevy

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 to an IRC server on port 6667.
  • WASM — web_sys::WebSocket against a gateway such as wss://chat.kbve.com.
RustBevy crate
DualTransport
IRCProtocol
MITLicense

What it gives you

Features

Dual transport, one API

Native builds use tokio TCP to IRC on port 6667; 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.

Bevy plugin

Optional plugin feature — ChatPlugin bridges incoming IRC traffic into ECS events for the isometric game.

FFI surface

Optional ffi feature (native only) — a C-FFI layer for JNI and csbindgen consumers.

Get started

Usage

main.rs
use bevy_chat::{ChatClient, IrcConfig};

let cfg = IrcConfig::default();
let client = ChatClient::connect(cfg).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 transport is selected at compile time via cfg(target_arch). Native builds use tokio TCP to an IRC server on port 6667, while 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.