技能标识:teamgram-session-layer
Documents the session routing layer and authsession service in Teamgram Server, covering auth_key aggregation, IDMap routing, MainAuthWrapper, and backpressure mechanisms.
session 的职责是把来自 gnetway 的 TLMessage2 流:
teamgramd/etc/session.yaml 中的 BFFProxyClients.IDMap 是关键:所有 /mtproto.RPC* 都路由到 bff.bff。
yaml
BFFProxyClients:
Clients:
- Etcd:
Key: bff.bff
IDMap:
/mtproto.RPCTos: bff.bff
/mtproto.RPCConfiguration: bff.bff
/mtproto.RPCAuthorization: bff.bff
/mtproto.RPCMessages: bff.bff
/mtproto.RPCContacts: bff.bff
/mtproto.RPCChats: bff.bff
/mtproto.RPCUsers: bff.bff
/mtproto.RPCUpdates: bff.bff
/mtproto.RPCFiles: bff.bff
/mtproto.RPCDialogs: bff.bff
/mtproto.RPCDrafts: bff.bff
/mtproto.RPCNotification: bff.bff
/mtproto.RPCAccount: bff.bff
/mtproto.RPCAutodownload: bff.bff
/mtproto.RPCNsfw: bff.bff
/mtproto.RPCChatInvites: bff.bff
/mtproto.RPCPrivacySettings: bff.bff
/mtproto.RPCUsernames: bff.bff
/mtproto.RPCPassport: bff.bff
/mtproto.RPCQrcode: bff.bff
/mtproto.RPCMiscellaneous: bff.bff
/mtproto.RPCSponsoredMessages: bff.bff
/mtproto.RPCPremium: bff.bff
/mtproto.RPCSavedMessageDialogs: bff.bff
/mtproto.RPCUserChannelProfiles: bff.bff
/mtproto.RPCPasskey: bff.bff
/mtproto.RPCVoipCalls: bff.bff
重要:如果新增 BFF 模块,必须在此 IDMap 中添加对应路由,否则 session 层会返回 METHODNOTIMPL 错误。
MainAuthWrapper 内部维护三个 SessionList:
通过以下 channel 解耦:
在 channel 满时返回 ErrDataChannelFull,让上游感知拥塞而不是 silent drop。
authsession 服务的定位是:
配置(teamgramd/etc/authsession.yaml)要点:
yaml
Name: service.authsession
ListenOn: 127.0.0.1:20450
Etcd:
Key: service.authsession
Mysql:
DSN: root:@tcp(127.0.0.1:3306)/teamgram?charset=utf8mb4&parseTime=true
Cache:
- Host: 127.0.0.1:6379
KV:
- Host: 127.0.0.1:6379
以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:
帮我安装 SkillHub 和 teamgram-session-layer-1776079929 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 teamgram-session-layer-1776079929 技能
skillhub install teamgram-session-layer-1776079929
文件大小: 2.82 KB | 发布时间: 2026-4-15 14:37