2881099 / FreeIM

.NETCore websocket 实现简易、高性能、集群即时通讯组件,支持点对点通讯、群聊通讯、上线下线事件消息等众多实用性功能.
MIT License
1.42k stars 418 forks source link

能发送图片信息吗? #7

Open tonglei2019 opened 4 years ago

tonglei2019 commented 4 years ago

这个怎么发送图片和语音信息呢?

2881099 commented 4 years ago

小的话base64就行,约定好数据格式,比如:

纯文本 {type:”text”,content:”内容”} 语音 {type:”sound”,content:”base64”} 或者 传一个 http 地址,客户端收到消息后下载该文件再播放,这个文件可以是 zip mp4

tonglei2019 commented 4 years ago

万分感谢

tonglei2019 commented 4 years ago

大神咱们的redis需要配置什么吗?我改成本地的Server端和本地的redis就发送不了信息了,大神是什么原因啊?

2881099 commented 4 years ago

只有那几个配置参数,理解一下

redis必须都指向同一台,同数据库 server参数必须是servers其中之一,并且可以当问到的imserver

tonglei2019 commented 4 years ago

我配置的就访问不到server呢,我的服务端配置 "ImServerOption": { "CSRedisClient": "ip,password=,poolsize=5,writeBuffer=20480", "Servers": "localhost:6001", "Server": "localhost:6001" },

这个是客户端配置 ImHelper.Initialization(new ImClientOptions { Redis = new CSRedis.CSRedisClient("ip,poolsize=5,password=,ssl=false,writeBuffer=20480"), Servers = new[] { "localhost:6001" } });

2881099 commented 4 years ago

imserver 启动为 localhost:6001,就行了

tonglei2019 commented 4 years ago

能加Q给大神发图片吗

2881099 commented 4 years ago

imserver启动的控制台窗口看下

tonglei2019 commented 4 years ago

谢谢大神 已经搞定了,回去后好好在看看,理解理解。