{"id":28364429,"url":"https://github.com/wildfirechat/app-server","last_synced_at":"2026-05-22T03:12:06.254Z","repository":{"id":37937681,"uuid":"166255554","full_name":"wildfirechat/app-server","owner":"wildfirechat","description":"Demo of IM application server","archived":false,"fork":false,"pushed_at":"2026-05-20T13:23:56.000Z","size":31459,"stargazers_count":279,"open_issues_count":4,"forks_count":393,"subscribers_count":13,"default_branch":"master","last_synced_at":"2026-05-20T17:59:48.639Z","etag":null,"topics":["chat","im"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wildfirechat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-01-17T16:13:09.000Z","updated_at":"2026-05-20T13:18:24.000Z","dependencies_parsed_at":"2024-06-26T06:29:03.468Z","dependency_job_id":"67fdb4ac-a6ea-4b78-bf4f-ac20610010c1","html_url":"https://github.com/wildfirechat/app-server","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/wildfirechat/app-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wildfirechat%2Fapp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wildfirechat%2Fapp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wildfirechat%2Fapp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wildfirechat%2Fapp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wildfirechat","download_url":"https://codeload.github.com/wildfirechat/app-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wildfirechat%2Fapp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33326807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat","im"],"created_at":"2025-05-28T20:44:20.664Z","updated_at":"2026-05-22T03:12:06.241Z","avatar_url":"https://github.com/wildfirechat.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 野火IM解决方案\n\n野火IM是专业级即时通讯和实时音视频整体解决方案，由北京野火无限网络科技有限公司维护和支持。\n\n主要特性有：私有部署安全可靠，性能强大，功能齐全，全平台支持，开源率高，部署运维简单，二次开发友好，方便与第三方系统对接或者嵌入现有系统中。详细情况请参考[在线文档](https://docs.wildfirechat.cn)。\n\n主要包括一下项目：\n\n\n| [GitHub仓库地址(主站)](https://github.com/wildfirechat)      | [码云仓库地址(镜像)](https://gitee.com/wfchat)        | 说明                                                                                      | 备注                                           |\n| ------------------------------------------------------------ | ----------------------------------------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------- |\n| [im-server](https://github.com/wildfirechat/im-server)       | [im-server](https://gitee.com/wfchat/im-server)          | IM Server                                                                                 |                                                |\n| [android-chat](https://github.com/wildfirechat/android-chat) | [android-chat](https://gitee.com/wfchat/android-chat) | 野火IM Android SDK源码和App源码                                                           | 可以很方便地进行二次开发，或集成到现有应用当中 |\n| [ios-chat](https://github.com/wildfirechat/ios-chat)         | [ios-chat](https://gitee.com/wfchat/ios-chat)         | 野火IM iOS SDK源码和App源码                                                               | 可以很方便地进行二次开发，或集成到现有应用当中 |\n| [pc-chat](https://github.com/wildfirechat/vue-pc-chat)       | [pc-chat](https://gitee.com/wfchat/vue-pc-chat)       | 基于[Electron](https://electronjs.org/)开发的PC 端                                        |                                                |\n| [web-chat](https://github.com/wildfirechat/vue-chat)         | [web-chat](https://gitee.com/wfchat/vue-chat)         | 野火IM Web 端, [体验地址](http://web.wildfirechat.cn)                                     |                                                |\n| [wx-chat](https://github.com/wildfirechat/wx-chat)           | [wx-chat](https://gitee.com/wfchat/wx-chat)           | 小程序平台的Demo(支持微信、百度、阿里、字节、QQ 等小程序平台)                             |                                                |\n| [app server](https://github.com/wildfirechat/app_server)     | [app server](https://gitee.com/wfchat/app_server)     | 应用服务端                                                                                |                                                |\n| [robot_server](https://github.com/wildfirechat/robot_server) | [robot_server](https://gitee.com/wfchat/robot_server) | 机器人服务端                                                                              |                                                |\n| [push_server](https://github.com/wildfirechat/push_server)   | [push_server](https://gitee.com/wfchat/push_server)   | 推送服务器                                                                                |                                                |\n| [docs](https://github.com/wildfirechat/docs)                 | [docs](https://gitee.com/wfchat/docs)                 | 野火IM相关文档，包含设计、概念、开发、使用说明，[在线查看](https://docs.wildfirechat.cn/) |                                                |\n\n## 野火IM后端应用\n作为野火IM的后端应用的演示，本工程具有如下功能：\n1. 短信登陆和注册功能，用来演示登陆应用，获取token的场景.\n2. PC端扫码登录的功能.\n3. 群公告的获取和更新功能.\n4. 客户端上传日志功能.\n\u003e 本工程为Demo工程，实际使用时需要把对应功能移植到您的应用服务中。如果需要直接使用，请按照后面的说明解决掉性能瓶颈问题。\n\n#### 编译\n```\nmvn clean package\n```\n\n## 打包RPM格式\n打包会生成Java包和deb安装包，如果需要rpm安装包，请在```pom.xml```中取消注释生成rpm包的plugin。另外还需要本地安装有rpm，在linux或者mac系统中很容易安装，在windows系统需要安装cygwin并安装rpm，具体信息请百度查询。\n\n修改之后运行编译命令```mvn clean package```，rpm包生成在```target```目录下。\n\n#### 短信资源\n应用使用的是腾讯云短信功能，需要申请到```appid/appkey/templateId```这三个参数，并配置到```tencent_sms.properties```中去。用户也可以自行更换为自己喜欢的短信提供商。在没有短信供应商的情况下，为了测试可以使用```superCode```，设置好后，客户端可以直接使用```superCode```进行登陆。上线时一定要注意删掉```superCode```。\n\n#### 修改配置\n本演示服务有4个配置文件在工程的```config```目录下，分别是```application.properties```, ```im.properties```, ```aliyun_sms.properties```和```tencent_sms.properties```。请正确配置放到jar包所在的目录下的```config```目录下。\n\u003e ```application.properties```配置中的```sms.verdor```决定是使用那个短信服务商，1为腾讯短信，2为阿里云短信\n\n#### 运行\n在```target```目录找到```app-XXXX.jar```，把jar包和放置配置文件的```config```目录放到一起，然后执行下面命令：\n```\njava -jar app-XXXXX.jar\n```\n\n#### 性能瓶颈\n本服务最早只提供获取token功能，后来逐渐增加了群公告/Shiro等功能，需要引入数据库。为了提高用户体验的便利性，引入了数据库[H2](http://www.h2database.com)，让用户可以无需安装任何软件就可以直接运行（JRE还是需要的），另外shiro的session也存储在h2数据库中。提高了便利性的同时导致一方面性能有瓶颈，另外一方面也不能水平扩展和高可用。因此需要使用本工程上线必须修改2个地方。\n1. 切换到MySQL，切换方法请参考 ```application.properties``` 文件中的描述。\n2. 使用RedisSessionDao，详情请参考 https://www.baidu.com/s?wd=shiro+redis\u0026tn=84053098_3_dg\u0026ie=utf-8\n3. 从0.53版本开始，应用服务改为无状态服务，可以集群部署。验证码和PC会话等信息都存放到数据库中，如果压力较大，可以二开引入redis缓存。\n\n#### 版本兼容\n+ 0.40版本引入了shiro功能，在升级本服务之前，需要确保客户端已经引入了本工程0.40版本发布时或之后的移动客户端。并且在升级之后，客户端需要退出重新登录一次以便保存session(退出登录时调用disconnect，需要使用false值，这样重新登录才能保留历史聊天记录，一定要在新版本中改成这样)。如果是旧版本或者没有重新登录，群公告和扫码登录功能将不可用。为了系统的安全性，建议升级。\n\n+ 0.43版本把Web和PC登录的短轮询改为长轮询，如果应用服务升级需要对Web和PC进行对应修改。\n\n+ 0.45.1 配置文件中添加了```wfc.all_client_support_ssl```开关，当升级到这个版本或之后时，需要配置文件中添加这个开关。\n\n+ 0.51版本添加了token认证。可以同时支持token和cookies认证，客户端也做了对应修改，优先使用token。注意做好兼容。\n\n+ 从0.53版本开始，所以数据都存储在数据库中，因此应用服务为无状态服务，可以部署多台应用服务做高可用和水平扩展。需要注意数据都是存储在数据库中，如果用户量较大或者业务量比较大，可以自己二开应用服务，添加redis缓存。\n\n#### 使用LDAP统一认证\n代码中添加了AD域登录的示例代码，可以在```application.properties```配置文件中打开ldap的配置并正确配置。需要ldap用户信息中，包含有电话号码。当登录时，先用电话号码查询到用户的dn，再用这个dn登录。如果遇到问题，请自己调试一下。调试时重点关注一下类```LdapMatcher```和```loginWithLdap```方法。\n\n#### 修改其他登录方式\n野火把登录功能从IM服务剥离，放到了应用服务中，目的是为了让客户更灵活的接入各种业务系统中进行登录。可以修改这个服务的任意代码，只要确保登录后从IM服务获取IM token返回给用户即可。\n\n#### 注意事项\n服务中对同一个IP的请求会有限频，默认是一个ip一小时可以请求200次，可以根据您的实际情况调整（搜索rateLimiter字符串就能找到）。如果使用了nginx做反向代理需要注意把用户真实ip传递过去（使用X-Real-IP或X-Forwarded-For)，避免获取不到真实ip从而影响正常使用。\n\n#### 使用到的开源代码\n1. [TypeBuilder](https://github.com/ikidou/TypeBuilder) 一个用于生成泛型的简易Builder\n\n#### LICENSE\nUNDER MIT LICENSE. 详情见LICENSE文件\n\n\n#### 使用阿里云短信\n请参考说明[使用阿里云短信](./aliyun_sms.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildfirechat%2Fapp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwildfirechat%2Fapp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildfirechat%2Fapp-server/lists"}