18 lines
309 B
Markdown
18 lines
309 B
Markdown
# Swarm Chat Tutorial
|
|
|
|
## Multi-Room Chat
|
|
|
|
```js
|
|
swarm.join(roomTopic)
|
|
swarm.on('connection', conn => {
|
|
const mux = new Protomux(conn)
|
|
const chat = mux.channel({protocol: 'chat'})
|
|
chat.msg.onmessage(msg => display(msg))
|
|
chat.open()
|
|
})
|
|
|
|
chat.msg.send('hi room!')
|
|
```
|
|
|
|
**Scale**: Firewall trusted keys.
|