Hootrix / websocketChatBaseSwoole

chat room

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

聊天室

简单的聊天室功能,需要服务器安装php swoole扩展。

Demo:http://chat.hhtjim.com

demo

服务器端:wsServer.php

基于php扩展swoole开发。 代码自swoole官方demo。

客户端 :chat.html

通过websocket通信.请勿使用IE家族浏览器访问

客户端UI

codepen.io

nginx反代参考

server
    {
        listen 80;
        #listen [::]:80;
        server_name chat.hhtjim.com;
        #index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/chat.hhtjim.com;

        #include other.conf;
        #error_page   404   /404.html;
        #include enable-php.conf;

        # 访问 ws://chat.hhtjim.com/ 下的内容将被反向代理到http://127.0.0.1:9501
        location /
        {
            proxy_pass http://127.0.0.1:9501;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }

       ...
    }

About

chat room

License:MIT License


Languages

Language:HTML 85.4%Language:PHP 14.6%