Coder Social home page Coder Social logo

hyperf-chat's Introduction

感谢sl-im作者提供的demo,自己就是想写一套im,用hyperf重写.

Php Version Swoole Version sl-im License

简介

hyperf-im 是基于 Hyperf 微服务协程框架和 Layim 网页聊天系统 所开发出来的聊天室。

体验地址

hyperf-im https://im.jayjay.cn

功能

  • 登录注册(Http)
  • 单点登录(Websocket)
  • 私聊(Websocket)
  • 群聊(Websocket)
  • 在线人数(Websocket)
  • 获取未读消息(Websocket)
  • 好友在线状态(Websocket)
  • 好友 查找 添加 同意 拒绝(Http+Websocket)
  • 群 创建 查找 添加 同意 拒绝(Http+Websocket)
  • 聊天记录存储
  • 心跳检测
  • 消息重发
  • 断线重连
  • 发送图片及文件

Requirement

部署方式

Composer

composer update

env配置

vim .env

WS_URL=wss://im.jayjay.cn/im
STORAGE_IMG_URL=
STORAGE_FILE_URL=

nginx配置

server{
    listen 80;
    server_name im.jayjay.cn;
    return 301 https://$server_name$request_uri;
}

server{
    listen 443 ssl;
    root /data/wwwroot/;
    add_header Strict-Transport-Security "max-age=31536000";
    server_name im.jayjay.cn;
    access_log /data/wwwlog/im.jayjay.cn.access.log;
    error_log /data/wwwlog/im.jayjay.cn.error.log;
    client_max_body_size 100m;
    ssl_certificate /etc/nginx/ssl/full_chain.pem;
    ssl_certificate_key /etc/nginx/ssl/private.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    location / {
        proxy_pass http://127.0.0.1:9501;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Real-PORT $remote_port;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
   
    location /im {
        proxy_pass http://127.0.0.1:9502;
        proxy_http_version 1.1;
        proxy_read_timeout   3600s;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
   
    location ~ .*\.(js|ico|css|ttf|woff|woff2|png|jpg|jpeg|svg|gif|htm)$ {
        root /data/wwwroot/IM/public;
    }
}

Start

  • 挂起
php bin/hyperf.php start

TODO

1.完善整体项目 2.加入webrtc(视频聊天)

联系方式

  • WeChat:naicha_1994
  • QQ:847050412

License

LICENSE

hyperf-chat's People

Contributors

aurorayolo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.