Install Centrifugo and quick start

Install Centrifugo and quick start

Go is a perfect language - it gives developers an opportunity to have single binary executable file for application and cross-compile application on all target operating systems for distribution. This means that all you need to get Centrifugo - download latest release for you operating system, unpack it and you are done!

Now you can see help information for Centrifugo:

./centrifugo -h

Centrifugo server node requires configuration file with secret key. If you are new to Centrifugo then there is genconfig command which can generate minimal required configuration file for you:

+

 

./centrifugo genconfig

It will generate secret key for you automatically and create configuration file config.json in current directory (by default) so you can finally run Centrifugo instance:

./centrifugo --config=config.json

We will talk about configuration in detail in next sections.

You can also put or symlink centrifugo into your bin OS directory and run it from anywhere:

centrifugo --config=config.json

In production you will need to daemonize Centrifugo. We have prebuilt rpm and deb packages for most popular Linux distributions and Docker image. See more Deploy section for more info.

 

 

实际安装配置使用:

config.json:

[root@pre centrifugo]# cat /data/centrifugo/config.json
{
"secret": "y**********42",
"web": true,
"admin_password": "y***********42",
"admin_secret": "y*************42",
"namespaces": [
{
"name": "public",
"anonymous": true,
"publish": true,
"watch": true,
"presence": true,
"join_leave": true,
"history_size": 10,
"history_lifetime": 30,
"recover": true
}
]
}

 

启动方式:

/data/centrifugo/centrifugo -c /data/centrifugo/config.json -p 9111 --insecure_admin --log_file /data/centrifugo/centrifugo/error.log --log_level info --web &

二进制文件下载:

https://github.com/centrifugal/centrifugo/releases

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Centrifugo 是一个用 Golang 实现的基于 Websocket 或者 SockJS 的实时通信平台。支持数千个同时连接,提供基于频道的出版/订阅模式。PUB/SUB容易和现有系统集成– 不改变已有后端情况下为系统提供实时通信能力。HTTP API 和已有后端通信 . API clients for Python, Ruby, PHP, Go, NodeJS.浏览器可以通过SockJS或者纯粹Websocket协议和centrifugal通信. 提供 iOS和Android平台SDK采用Redis实现分布式部署.SHA-256 HMAC连接认证和隐私保护多种类型的频道 – 私有, 用户限制,客户端限制通过名字空间灵活配置频道支持即时消息和历史消息支持用户加入/离开消息网络重连后可以恢复消息内置管理界面,提供多种计量(Metrics)可用于WebRTC信令服务器多种部署手段(docker 镜像, RPM/DEB 包, Nginx 配置, TLS certificates)MIT license通讯模型:Centrifugo 包含如下子项目:centrifugo - 采用 Go 语言开发的实时消息传递服务器centrifuge-js - Javascript 客户端,可直接在浏览器使用centrifuge-android - Android 的客户端开发包,可通过 WebSockets 与服务器通讯centrifuge-ios - Swift 开发包centrifuge-go - Go 客户端开发包cent - Python 开发包adjacent - Cent 的小型封装包,简化了与 Django 框架的集成rubycent - Ruby gem to communicate  with Centrifugo server API.phpcent - PHP client to communicate  with Centrifugo server API.gocent - Go client to communicate  with Centrifugo server API.jscent - NodeJS client to communicate  with Centrifugo server API.web - Centrifugo 的管理界面,基于 ReactJS 开发 标签:Centrifugo

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值