• Articles
  • advertising chart
    advertising chart
    Want to show up here too?Contact us.

    Resource Profile:

    建议使用火狐或Google Chrome浏览器进行测试,以免出现兼容性问题。架设该系统稍显复杂,不建议新手尝试,否则可能会遇到一些困难。如果你发现没有数据库的情况下无法运行,请注意查看相关配置,避免出现不必要的问题。
    该聊天室系统名为SL-IM,是基于Swoft微服务协程框架和LayIM网页Chat system开发的。
    由于版权原因,我们已将public\layim\lay\modules目录下的layim.js文件删除。你可以前往官方获取或者在其他地方找到该文件。我们不提供该文件的下载。请注意,获取该文件需遵守相关法律法规。
    主要功能包括:

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

    Photo Gallery:

    基于Swoft+LayIM的Web版高仿QQPHP聊天室源码下载-效果图1

    基于Swoft+LayIM的Web版高仿QQPHP聊天室源码下载-效果图2

    基于Swoft+LayIM的Web版高仿QQPHP聊天室源码下载-效果图3

    基于Swoft+LayIM的Web版高仿QQPHP聊天室源码下载-效果图4

    Installation and usage instructions:

    环境要求:

    • PHP 7.1+
    • Swoole 4.3.4+
    • Composer
    • Swoft >= 2.0.8

    部署方式:

    Composer
    composer update
    bean
    app/bean.php
    
    'db' => [
    'class' => Database::class,
    'dsn' => 'mysql:dbname=im;host=127.0.0.1:3306',
    'username' => 'root',
    'password' => 'gaobinzhan',
    'charset' => 'utf8mb4',
    ],
    'db.pool' => [
    'class' => \Swoft\Db\Pool::class,
    'database' => bean('db'),
    'minActive' => 5, // 自己调下连接池大小
    'maxActive' => 10
    ],
    数据表迁移
    php bin/swoft mig:up  

    nginx配置:

    server{
        listen 80
        server_name im.xx.com
         301 https://}
    server{
    listen 443 ssl;
    root /data/wwwroot/IM/public/;
    add_header Strict-Transport-Security "max-age=31536000";
    server_name im.gaobinzhan.com;
    access_log /data/wwwlog/im-gaobinzhan-com.access.log;
    error_log /data/wwwlog/im-gaobinzhan-com.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:9091;
    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 /upload {
    root /data/wwwroot/IM/public;
    }
    location /im {
    proxy_pass http://127.0.0.1:9091;
    proxy_http_version 1.1;
    proxy_read_timeout 3600s;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    }
    location /video {
    proxy_pass http://127.0.0.1:9091;
    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/swoft ws:start
    守护进程化
    php bin/swoft ws:start -d

    advertising chart
    advertising chart
    Want to show up here too?Contact us.
    Frequently Asked Questions FAQ
    Can free downloads or VIP member-only resources be commercialized directly?
    The resources on this site are collected and organized through the network, for personal research and study purposes only. The copyright belongs to the legal owner of the software and program code, users should verify the copyright and legality of the resources, prohibited for commercial use, illegal activities or any violation of national laws and regulations.
    Disclaimer of liability for program or code bugs, compatibility issues or functional defects, etc.
    As the resources on this site are collected and organized through the network, not the site's original, it can not fully guarantee its functionality or code compatibility. Users need to verify whether the resources meet the needs of their own, due to the following circumstances lead to losses, this site does not assume any responsibility:
    Programs, source code and other computer software resources may contain code vulnerabilities (bugs), compatibility issues or functional defects left by the developer. This site does not provide free repair services for such technical defects, users need to bear the risk of debugging, modification or abandonment of the use.
    © 2025 by - SourceHub & Www.ZYYdd.Com. All rights reserved 蜀ICP备2025145155号-1