# flamingoim **Repository Path**: mirrors/flamingoim ## Basic Information - **Project Name**: flamingoim - **Description**: flamingoIM 是一款高性能、轻量级的即时通讯软件。 目前即时通讯软件实现了如下功能(这里只列举网络相关的功能,其他客户端已经实现的功能不统计在列,请自行发现): 注册 登录 查找好友、查找群 添加好友、添加群 好友列表、群列表、最近会话 单人聊天功能(包括发文字、表情、窗口抖动、离线文件) 群组功能(包括发文字、表情) 群发消息 修改密码 修改个人信息(自定义昵称、签名、个性头像等个人信息) 自动升级功能 客户端还有很多细节功能,比如头像有三种显示模式、好友上线动画、聊天记录、聊天自动回复功能等,有兴趣的同学可以自己探索尝试一下吧,这里就不截图了。 下面介绍一下服务器代码和pc客户端代码的编译与运行环境: flamingo服务器端代码使用cmake + makefile编译,使用了纯C++11开发,运行于linux系统下(我的系统是CentOS7.0),为了支持C++11,你的gcc版本至少要大于4.7,我的版本是4.8.5。另外,使用了数据库,我的数据库版本是5.7.17。服务器代码不仅是一款即时通讯软件的服务器代码,同时也是一款通用的C++11服务器框架。 服务器代码使用方法: 进入程序目录,输入cmake . (注意有一个点号,表示当前目录) 没有错误,输入make 3.最终会产生三个可执行程序,mychatserver、myfilesever和myimgserver。编译完成 部署方法: 简单说明:mysql数据库的用户名为root,密码为空,请根据你自己的需要设置相应的用户名和密码(目前写死在程序中)。mychatserver是聊天服务器,myfileserver是文件服务器,文件服务器负责上传和下载聊天中发送的文件,myimgserver负责上传和下载聊天中的图片。三个服务相互独立,互不影响。聊天服务器监听端口是20000,文件服务器端口是20001,图片服务器端口号是20002,这三个端口供客户端连接,其中聊天端口和客户端是长连接,文件端口和图片可选择长连接或短连接。 第一次运行mychatserver时,如果能顺利连上mysql,mychatserver会自动检测是否存在名为myim的数据库,如果不存在则创建,并新建三张信息表,分别是用户信息表:t_user, 好友关系表t_user_relationship和聊天消息记录表t_chatmsg。第一次启动文件服务器时会创建filecache目录,这个目录用来存储聊天中的聊天图片和离线文件以及客户端升级包。 为了方便查看代码,我用Visual Studio来管理代码,可使用VS打开myserver.sln查看和管理代码。(VS版本必须是VS2013或以上版本) 客户端代码使用方法: 编译: 1.用VS2013打开程序目录下的:Flamingo.sln,你可以使用其他的VS版本,但是至少不低于VS2013,因为客户端代码也使用了大量C++11语法和库,VS2013及以上版本才能较好的支持C++11的语法。 打开的解决方案包括三个项目:Flamingo是即时通讯主程序,CatchScreen是聊天中使用的截图工具,iUpdateAuto是升级功能中用到的解压工具。 用VS2013编译整个解决方法即可,编译成功以后将在Bin目录下生成对应的程序。启动Flamingo.exe注册一个账号就可以开始使用flamingo了。 如果你暂时不想研究服务器代码,但又想使用客户端,你可以连接我的测试服务器,测试服务器地址是: 聊天服务器地址:120.55.94.78 端口号:20000 文件服务器地址:120.55.94.78 端口号:20001 图片服务器地址:120.55.94.78 端口号:20002 你可以在登录界面的网络设置里面进行设置(登录界面右上角最小化按钮左边的一个按钮)。 详情参见: http://blog.csdn.net/analogous_love/article/details/69481542 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 32 - **Forks**: 0 - **Created**: 2017-07-06 - **Last Updated**: 2025-12-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### Flamingo #### Introduction Flamingo is a high-performance & light-weight open-source IM software. It has server side, Windows pc version and android version so far, and Wechat version and IOS version is under developing. #### Feature List Flamingo has implemented these features below(Remind that we just list the features here related to network communication, as to some other features, you can explore them in Flamingo by yourself.) - user registering - user logining - searching users and groups - adding user to friend list & joining in groups - displaying friends list, group list and recent session list - chatting with a single friend (including sending texts, emotions, images, window shake and offline files, etc). - chatting in groups(include sending texts, emotions, etc) - sending messages to multiple friends or groups (This is different from chatting in groups) - modifying password - modifying one's profile(including nickname, signature, customed avatar, etc) - dectecting new version and upgrading automatically in Windows pc version - reconnecting automatically when disconnecting - some other handsome features, such as three mode of friend list, playing animations when a friend going online, chat message history, auto-replying chat message when chatting, etc. You can explore more amazing features by your own in Flamingo. #### Compile and Install ##### Compiling and Installing of Server ###### Dev tools Dependencies 1. Install **cmake**, **makefile** and **gcc** tools. ​ Flamingo server is based on linux OS as platform(CentOS 7.0 is highly recommended), and compilers that support C++ 11 is required because the server code is fully developping with C++ 11. So on linux OS, the version of gcc/g++ must be high than 4.7(4.8.5 is recommended). In addition, cmake and makefile tool is required, so you need to install them. 2. install **mysql** ​ Flaming server uses mysql database to store user data. If your OS is CentOS 7.0, you need to install **mariadb-server**, **mariadb-client** and **mariadb-devel**. On other linux OS, you need to install **mysql-server**, **mysql-client** and **mysql-devel**. ​ The Flamingo **chatserver** will use mysql database. The default database is named "**flamingo**". The database name, login user account(including username, password, etc) is configured in the file **flamingoserver/etc/chatserver.conf**. You can change this configuration as you will. ​ When **chatserver** startups at first time, it will dectect whether the database you configured exist in mysql. If it does not exist, the **chatserver** will create it including creating its related tables. So you do not need to create the database and tables manually. However the SQL syntax of creating table differs a litle in different mysql version, some SQL of creating tables might failed in some mysql version, therefore under this condition, you have to create tables manually. We prepare these SQLs for you in the file **flamingoserver/table.sql**. Flamingo server uses four database tables illustrated below: | Table Name | Usage | | :-----------------: | :--------------------------------------------: | | t_user | store user accounts | | t_user_relationship | store user relationship and group members info | | t_chatmsg | store chatting message | ###### Compiling 1. Enter **flamingoserver/** directory, then type commands below: ``` cmake . ``` If no error occurs, a **Makefile** file will generated. We use this **Makefile** to generate server executable programs in next step. 2. Execute commands below to generate executable programs: **chatserver**、**fileserver**、**imgserver**. ```shell make ``` All servers usage illustrated below: | Server Name | Usage | | :---------: | :----------------------------------------------------------: | | chatserver | for user registeration, logining and chatting, and other IM essential functionalities | | fileserver | for offline files transferring when chatting and pc upgrading | | imgserver | for user avatar downloading & uploading and sending chatting image | ###### How to Startup Servers **chatserver**、**fileserver**、**imgserver** are independent with each other. You can startup one of them in Linux shell or run in daemon mode. Use following commands to run them in daemon mode: ```shell ./chatserver -d ./fileserver -d ./imgserver -d ``` ##### Port Usage You can use lsof command to confirm that the specified ports are on listening state normally: ```shell [zhangyl@localhost flamingoserver]$ lsof -i -Pn COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME chatserve 18540 zhangyl 19u IPv4 1129031 0t0 TCP *:20000 (LISTEN) chatserve 18540 zhangyl 27u IPv4 1129032 0t0 TCP *:8888 (LISTEN) chatserve 18540 zhangyl 35u IPv4 1129033 0t0 TCP *:12345 (LISTEN) fileserve 18552 zhangyl 25u IPv4 1130523 0t0 TCP *:20001 (LISTEN) imgserver 18562 zhangyl 25u IPv4 1131971 0t0 TCP *:20002 (LISTEN) ``` | Port Number | Owner | Usage | | :---------: | :--------: | :----------------------------------------------------------: | | 20000 | chatserver | Chatting Port | | 8888 | chatserver | Port for monitoring chatserver's inner state, you can use telnet or nc command to connect to chatserver to retrieve some realtime status and information of chatserver | | 12345 | chatserver | Http service port for chatserver, chatserver both support long TCP and short http connections | | 20001 | fileserver | File transferring port | | 20002 | imgserver | Tranferring port for sent chat images or user avatars | We can use Linux nc command to connect to the Port 8888 of chatserver in table above, in the form of **nc -v ip port**. The port argument here is 8888 and -v option makes nc command to display more detailed information. Here is the usage: ``` [zhangyl@localhost flamingoserver]$ nc -v 127.0.0.1 8888 Ncat: Version 6.40 ( http://nmap.org/ncat ) Ncat: Connected to 127.0.0.1:8888. 1. help-show help info 2. ul-show online user list 3. su-show userinfo specified by userid: su [userid] ul No user online. su please specify userid. help 1. help-show help info 2. ul-show online user list 3. su-show userinfo specified by userid: su [userid] ``` When connected to chatserver with **nc** successfully, you can type any one of the commands in the given list. I hava just implemented three commands as examples, namely: help, ul, su. You can add more functional commands if you need. **Hint:** The server code is not only an IM Server source, but also a powerfully network framework writting in C++ 11. You will be able to of benefit more from it if you explore it more. #### PC Client Compiling and Installing All you need to do is just that open file **Flamingo.sln** in **flamingoclient/** directory with Visual Studio 2019 and compile it . The solution includes three projects illstrated in the table below:: | Project Name | Usage | | :----------: | :------------------------------------------------: | | Flamingo | The main executable program of Flamingo pc client. | | CatchScreen | A tool to catch screen in chatting window. | | iUpdateAuto | Unzipping downloading files when upgrades. | ​ When compiling finished successfully, the executable programs will be located in directory **flamingoclient\Bin**. And the configuration file which contains configured lines is located in file **flamingoclient\Bin\config\flamingo.ini**. Run **Flamingo.exe** and have fun! #### Android Version Compiling and Installing Use Android Studio to open the project in directory **flamingoAndroid** and build to generate **flamingo.apk** file. Install **flamingo.apk** to your mobiles. Server settings of Android version is on the logining Activity. #### Change Log I am afraid that I can not maintain Flamingo in regular intervals because I am very busy with my own work. But I promise that I am going to maintain Flamingo continually. Change Log see here: [Flamingo Change Log](https://github.com/baloonwj/flamingo/issues/1) #### BUG Report If you have any questions, you can contact with me by sending email to balloonwj@qq.com. Also, you can report any bugs in the BUG Report Page, its link is https://github.com/baloonwj/flamingo/issues/5. I promise that fatal problem of Flamingo, such as crashing or halting will be solved in three weekdays and other questions that are not severe will be responsed in two weeks. #### Contact At last not the least, if you have any suggestions or questions, welcome to contact with me. China Mainland users can contact with me by joining in my QQ group(**729995516**) or linking my public webchat account(『**easy_coder**』). Also you can send me emails, my email address is **balloonwj@qq.com**. I am waiting for You sincerely. #### Features Snapshot Below: ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/1.png) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/2.png) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/3.png) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/4.png) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/5.png) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/6.png) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/7.png) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/8.png) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/9.png) ##### Android Version Snapshot ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/m1.jpg) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/m2.jpg) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/m3.jpg) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/m4.jpg) ![flamingo Snapshot](https://github.com/balloonwj/flamingo/blob/master/snapshots/m5.jpg)