Router vs Relay
lsbot provides two modes for connecting to chat platforms: router and relay.
Quick Comparison
| Feature | router (Self-hosted) | relay (Cloud) |
|---|---|---|
| Architecture | Direct connection to platform APIs | Connect to lsbot cloud (bot.lingti.com) |
| Server needed | Requires port forwarding / tunnel | No server needed |
| Platforms | All 19 platforms | feishu, slack, wechat, wecom |
| Data flow | User → Platform → Your PC → AI | User → Platform → Cloud → Your PC → AI |
When to use router
Use router when:
- You want full control over the connection
- The platform is not supported by relay
- You need to run multiple platforms simultaneously
- You have a server with public IP or use a tunnel (frp, ngrok, Cloudflare Tunnel)
All 19 platforms are supported in router mode.
When to use relay
Use relay when:
- You don't have a server with public IP
- You want the easiest setup (no firewall, no tunnel)
- The platform is supported: feishu, slack, wechat, wecom
The cloud relay handles the platform connection for you. Your AI runs locally.
Platform Support by Mode
| Platform | router | relay |
|---|---|---|
| DingTalk (钉钉) | ✅ Stream Mode | ❌ Not needed* |
| Feishu (飞书) | ✅ WebSocket | ✅ |
| Slack | ✅ Socket Mode | ✅ |
| WeCom (企业微信) | ✅ Callback API | ✅ |
| WeChat (微信公众号) | ❌ | ✅ Cloud only |
| Telegram | ✅ | ❌ |
| Discord | ✅ | ❌ |
| ✅ | ❌ | |
| LINE | ✅ | ❌ |
| Teams | ✅ | ❌ |
| Others... | ✅ | ❌ |
* DingTalk uses Stream Mode (WebSocket) which is inherently "serverless" — same benefit as cloud relay, so relay is not needed.
Why DingTalk has no relay
DingTalk already supports Stream Mode, a native WebSocket connection that works without a public server:
This achieves the same goal as cloud relay — no need to buy a server or configure a tunnel. Therefore, DingTalk doesn't need relay support.
How each mode works
Router (Self-hosted)
You run lsbot gateway locally. The bot connects directly to the platform's API.
Relay (Cloud)
You run lsbot relay locally. The cloud server handles the platform connection and forwards messages to your local instance via WebSocket.
Summary
- router: Full control, all platforms, may need a server/tunnel
- relay: Easiest setup for supported platforms, no server needed
- DingTalk: Uses Stream Mode = no server needed = router only