Expand description
Socket.IO chat channel — port of wabot-ts
addon/chat-controller/socket/SocketChannel.ts. Built on
socketioxide.
Runs its own axum server on a configurable bind address (sharing
with the REST router is a future enhancement — would let one
process expose REST + WebSocket on the same port). Listens on the
configured namespace for "message" events whose payload matches
SocketIncoming; each message becomes a ChannelMessage and is
forwarded to the chat-controller framework. Replies emit "message"
back to the originating socket.
§Configuration
Register a SocketChannelConfig singleton before
register_singletons!(&c, SocketChannel):
ⓘ
c.register_instance::<SocketChannelConfig>(Arc::new(
SocketChannelConfig::new("/chat", "0.0.0.0:3001"),
));
register_singletons!(&c, SocketChannel);Structs§
- Socket
Channel - Socket.IO chat channel. Cheap to clone (
Arc-internal); construct once per process and register as a singleton. - Socket
Channel Config - Bind address + namespace + CORS for the socket.io server.
- Socket
File - File attachment payload over socket.io.
- Socket
Incoming - Inbound message shape — matches
SocketChannelReceivedMessagefrom the TS addon. All exceptchat_idis optional.