
外观
外观
基于FreeIM开发的即时通讯服务端项目,业务和推送分离设计,终端连接永不更新重启
MyImServer,业务代码全部在MyApp项目编写,因此重启MyApp项目不会造成连接断开。每个
MyImServer管理着对应的终端连接,当接收到redis订阅消息后,向对应的终端连接推送数据。当业务应用
imconfig.json开启 im 时,同时要启动 im 服务器集群地址中的 im 服务端项目
dotnet new install ZhonTai.Template.IMServer升级模板命令和安装模板命令相同
dotnet new install ZhonTai.Template.IMServer::9.0.4dotnet new MyIMServer -h-p, --port <port>   Port settings
                    类型: int
                    默认: 17010dotnet new uninstall ZhonTai.Template.IMServerdotnet new MyIMServer -n MyCompanyName.MyIMServerdotnet new MyIMServer -n MyCompanyName.MyIMServer -p 17010应用程序配置文件
{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*",
  "Urls": "http://*:17010",
  //im服务端配置
  "ImServerConfig": {
    //Redis客户端连接字符串
    "RedisClientConnectionString": "127.0.0.1:6379,password=,poolsize=10,defaultDatabase=6",
    //服务端列表
    "Servers": [ "127.0.0.1:17010" ],
    //服务端
    "Server": "127.0.0.1:17010",
    //输入编码名称
    "InputEncodingName": "GB2312",
    //输出编码名称
    "OutputEncodingName": "GB2312",
    //健康检查
    "HealthChecks": {
      //启用
      "Enable": true,
      //访问路径
      "Path": "/health"
    }
  }
}注意
redis 默认数据库必须要和业务应用 imconfig.json 中的默认数据库保存一致
开发启动配置文件,用于配置启动参数,如环境变量、启动端口等。
{
  "$schema": "https://json.schemastore.org/launchsettings.json",
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:17010",
      "sslPort": 0
    }
  },
  "profiles": {
    "ImServer": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "launchUrl": "",
      "applicationUrl": "http://localhost:17010",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}