项目作者: pushiqiang

项目描述 :
centrifugo + sanic demo
高级语言: JavaScript
项目地址: git://github.com/pushiqiang/centrifugo_sanic_example.git
创建时间: 2017-12-11T14:52:48Z
项目社区:https://github.com/pushiqiang/centrifugo_sanic_example

开源协议:

下载


Centrifugo_sanic_example

中文介绍: http://blog.csdn.net/pushiqiang/article/details/78746145

英文介绍: @fzambia/four-years-in-centrifuge-ce7a94e8b1a8"">https://medium.com/@fzambia/four-years-in-centrifuge-ce7a94e8b1a8

启动centrifugo服务

  1. 1: cd ./centrifugo_server_docer
  2. 2: 配置config.json(配置secret, admin_password等参数)
  3. 3: docker-compose up -d

启动后访问http://localhost:9000/查看服务是否启动

启动demo

  1. 1: 配置src/configs/base_config.py(配置CENTRIFUGO_SECRET, CENTRIFUGO_URL等参数)
  2. 2: cd ./docker
  3. 3: docker-compose up -d

测试

访问http://localhost:8008/等待消息接收

访问http://localhost:8008/send发送消息,并查看已打开的http://localhost:8008/是否刷新了消息

或者访问http://localhost:9000/,在actions中像news 通道发送消息,看http://localhost:8008/是否刷新了消息