All Projects → Hyperf-Glory → Socket Io

Hyperf-Glory / Socket Io

Licence: mit
基于Hyperf微服务协程框架开发的sokcet-io分布式系统

Projects that are alternatives of or similar to Socket Io

Nagios Plugins
450+ AWS, Hadoop, Cloud, Kafka, Docker, Elasticsearch, RabbitMQ, Redis, HBase, Solr, Cassandra, ZooKeeper, HDFS, Yarn, Hive, Presto, Drill, Impala, Consul, Spark, Jenkins, Travis CI, Git, MySQL, Linux, DNS, Whois, SSL Certs, Yum Security Updates, Kubernetes, Cloudera etc...
Stars: ✭ 1,000 (+2531.58%)
Mutual labels:  mysql, redis, rabbitmq, consul
Docker Compose
一些基础服务的docker-compose配置文件,方便在一台新电脑上快速开始工作
Stars: ✭ 163 (+328.95%)
Mutual labels:  mysql, redis, rabbitmq, consul
Zapi
基于swoole的异步轻量级api框架,内部封装全套mysql、redis、mongo、memcached异步客户端,可以轻松start、reload、stop,加入数据库的查询模块,框架已经封装好近乎同步写法,底层异步调用。现已支持异步mysql、异步redis、异步http请求.
Stars: ✭ 245 (+544.74%)
Mutual labels:  mysql, redis, swoole
Surging
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service gove…
Stars: ✭ 3,088 (+8026.32%)
Mutual labels:  redis, rabbitmq, consul
Gnomock
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻
Stars: ✭ 398 (+947.37%)
Mutual labels:  mysql, redis, rabbitmq
Microservices Sample
Sample project to create an application using microservices architecture
Stars: ✭ 167 (+339.47%)
Mutual labels:  mysql, rabbitmq, consul
Javacollection
Java开源项目之「自学编程之路」:学习指南+面试指南+资源分享+技术文章
Stars: ✭ 2,957 (+7681.58%)
Mutual labels:  mysql, redis, rabbitmq
Full Stack Notes
全栈工程师手册
Stars: ✭ 366 (+863.16%)
Mutual labels:  mysql, redis, rabbitmq
Dtcqueuebundle
Symfony2/3/4/5 Queue Bundle (for background jobs) supporting Mongo (Doctrine ODM), Mysql (and any Doctrine ORM), RabbitMQ, Beanstalkd, Redis, and ... {write your own}
Stars: ✭ 115 (+202.63%)
Mutual labels:  mysql, redis, rabbitmq
Pdf
编程电子书,电子书,编程书籍,包括C,C#,Docker,Elasticsearch,Git,Hadoop,HeadFirst,Java,Javascript,jvm,Kafka,Linux,Maven,MongoDB,MyBatis,MySQL,Netty,Nginx,Python,RabbitMQ,Redis,Scala,Solr,Spark,Spring,SpringBoot,SpringCloud,TCPIP,Tomcat,Zookeeper,人工智能,大数据类,并发编程,数据库类,数据挖掘,新面试题,架构设计,算法系列,计算机类,设计模式,软件测试,重构优化,等更多分类
Stars: ✭ 12,009 (+31502.63%)
Mutual labels:  mysql, redis, rabbitmq
Groupco
PHP的服务化框架。适用于Api、Http Server、Rpc Server;帮助原生PHP项目转向微服务化。出色的性能与支持高并发的协程相结合
Stars: ✭ 473 (+1144.74%)
Mutual labels:  mysql, redis, swoole
Docker Alpine
Docker containers running Alpine Linux and s6 for process management. Solid, reliable containers.
Stars: ✭ 574 (+1410.53%)
Mutual labels:  redis, rabbitmq, consul
Zhttp
基于swoole的异步轻量级web框架,内部封装协程异步非阻塞全套mysql、redis、mongo、memcached连接池,可以轻松start、reload、stop,加入数据库的查询模块,框架已经封装好近乎同步写法,底层异步调用
Stars: ✭ 131 (+244.74%)
Mutual labels:  mysql, redis, swoole
Kickoff Docker Php
🐳 🐘 🚀 Easily setup a PHP project with Docker
Stars: ✭ 213 (+460.53%)
Mutual labels:  mysql, redis, rabbitmq
Charroom
PHP + Swoole 聊天室
Stars: ✭ 125 (+228.95%)
Mutual labels:  mysql, redis, swoole
Reading
整理阅读过的干货文章, 帖子
Stars: ✭ 318 (+736.84%)
Mutual labels:  mysql, redis, swoole
Bifrost
Bifrost ---- 面向生产环境的 MySQL 同步到Redis,MongoDB,ClickHouse,MySQL等服务的异构中间件
Stars: ✭ 701 (+1744.74%)
Mutual labels:  mysql, redis, rabbitmq
Flink Learning
flink learning blog. http://www.54tianzhisheng.cn/ 含 Flink 入门、概念、原理、实战、性能调优、源码解析等内容。涉及 Flink Connector、Metrics、Library、DataStream API、Table API & SQL 等内容的学习案例,还有 Flink 落地应用的大型项目案例(PVUV、日志存储、百亿数据实时去重、监控告警)分享。欢迎大家支持我的专栏《大数据实时计算引擎 Flink 实战与性能优化》
Stars: ✭ 11,378 (+29842.11%)
Mutual labels:  mysql, redis, rabbitmq
Mall
mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。
Stars: ✭ 54,797 (+144102.63%)
Mutual labels:  mysql, redis, rabbitmq
Cookbook
🎉🎉🎉JAVA高级架构师技术栈==任何技能通过 “刻意练习” 都可以达到融会贯通的境界,就像烹饪一样,这里有一份JAVA开发技术手册,只需要增加自己练习的次数。🏃🏃🏃
Stars: ✭ 428 (+1026.32%)
Mutual labels:  mysql, redis, rabbitmq

服务器马上到期,demo预览不了。后续会补上.谢谢各位的star

请暂时不要用于生产环境

项目还在开发优化中

Socket-IO

再次升级,此版本采用hyperf2.x+Vue+Element搭建的分布式Socket-io系统,利用rpc作为注册,鉴权服务,rpc发布到注册中心.利用dao-cloud+docker多容器部署目前已初步搭建完成,待完成系统业务会继续优化,写份教程供大家学习. 此次系统的业务逻辑借鉴lumen-im 的逻辑用hyperf重写,第一版本求稳定运行上线.第二版本会重新整理业务架构,代码更加优化。更加符合PHP规范化.

Socket-IO服务聊天系统

Php Version Swoole Version sl-im License

简介

socket-io 是基于 Hyperf 微服务协程框架(Swoole)和 Vue + ElementUI 网页聊天系统 所开发出来的聊天室。

体验地址

Socket-IO

功能

1.0

  • 基于Swoole Socket-io服务做消息即时推送
  • 支持私聊及群聊
  • 支持聊天消息类型有文本、代码块、图片及其它类型文件,并支持文件下载
  • 支持聊天消息撤回、删除或批量删除、转发消息(逐条转发、合并转发)
  • 支持docker部署(后续写搭建教程)
  • Rpc服务注册登录鉴权
  • Nsq分布式消息中间件
  • Mysql提供数据存储功能
  • Redis存储聊天关系映射

问题

Json-Rpc 业务架构比较混乱和Service层架构冲突。下个版本着重优化,把HTTP和Rpc部分业务分到Service层. 代码规范不符合现代化.有重复的代码使用.socket-io服务单独重构独立成为分布式服务 也许它存在很多问题,但是也请大家多一份耐心,毕竟一个人的开发精力有限。项目我会一直维持下去。 也希望证明php也是可以做分布式的。恢复php荣光,我辈义不容辞.

2.0

  • 重新架构
  • 代码更符合PHP标准化

Requirement

单机部署方式

Composer

composer install

env配置

APP_NAME=skeleton
APP_ENV=dev

DB_DRIVER=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=hyperf
DB_USERNAME=root
DB_PASSWORD=
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
DB_PREFIX=

REDIS_HOST=localhost
REDIS_AUTH=(null)
REDIS_PORT=6379
REDIS_DB=0

CLOUD_REDIS=default

WEBSOCKET_SERVER_IPS = {"ws1":"127.0.0.1","ws2":"127.0.0.2"}
AMQP_HOST=localhost //rabbitmq地址
NSQ_HOST=localhost //nsq地址
CONSUL_HOST=localhost:8500 //consul地址
NSQD_HOST=127.0.0.1:4151 //nsqd地址

//邮箱配置
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_FROM=
MAIL_NAME=
//静态资源地址
IMAGE_URL=http://127.0.0.1:9500
//七牛配置
QINIU_ACCESS_KEY=
QINIU_SECRET_KEY=
QINIU_BUCKET=
QINBIU_DOMAIN=

nginx配置

# 至少需要一个 Hyperf 节点,多个配置多行
upstream hyperf_chat_http {
    # Hyperf-Chat HTTP Server 的 IP 及 端口
    server 127.0.0.1:9500;
    server 127.0.0.1:1500;
}
upstream hyperf_chat_ws {
    # 设置负载均衡模式为 IP Hash 算法模式,这样不同的客户端每次请求都会与同一节点进行交互
    ip_hash;
    # Hyperf Chat Server 的 IP 及 端口
    server 127.0.0.1:9502;
    server 127.0.0.1:1502;
}
server {
    listen 443 ssl;
    index index.html index.htm;
    server_name xxx.cn;
  error_log /home/wwwlogs/xxxerr.log;
    root /home/wwwroot/hyperf-chat/public;
    ssl_certificate /etc/ssl/xxx.crt;
    # 指定私钥文件路径
    ssl_certificate_key /etc/ssl/xxx.key;
    ssl_protocols        TLSv1.2 TLSv1.1 TLSv1;
        ssl_ciphers   ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_prefer_server_ciphers   on;
        ssl_session_timeout 5m;
      index index.php index.html index.htm;
    location / {
        # 将客户端的 Host 和 IP 信息一并转发到对应节点
           proxy_set_header Host $http_host;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

               # 转发Cookie,设置 SameSite
           proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict";

               # 执行代理访问真实服务器
           proxy_pass http://hyperf_chat_http;
    }
    location /socket.io {
        # WebSocket Header
         proxy_http_version 1.1;
         proxy_set_header Upgrade websocket;
         proxy_set_header Connection "Upgrade";

         # 将客户端的 Host 和 IP 信息一并转发到对应节点
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header Host $http_host;

         # 客户端与服务端无交互 60s 后自动断开连接,请根据实际业务场景设置
         proxy_read_timeout 60s ;

               # 执行代理访问真实服务器
         proxy_pass http://hyperf_chat_ws;
    }
}
server
{
  # 80端口是http正常访问的接口
  listen 80;
  server_name xxx.cn;
  # 在这里,我做了https全加密处理,在访问http的时候自动跳转到https
  rewrite ^(.*) https://$host$1 permanent;
}

Start

  • 挂起
composer dump-autoload -o
php bin/hyperf.php start

打赏(你的支持是我最大的动力)

联系方式

  • WeChat:naicha_1994
  • QQ:847050412
  • QQ群:658446650

socket-io欢迎star

socket-io

License

LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].