Giter Club home page Giter Club logo

swoole-webim-demo's Introduction

在线聊天室(Making a Web Chat With PHP and Swoole)


@author: 翎羽鹭

@email: [email protected]

使用swoole扩展和php开发的一个在线聊天室,目前实现的功能有

  • 支持群聊
  • 支持发送文字
  • 支持发送图片
  • 支持@人
  • 支持分房间聊天功能
  • 显示消息数

在线聊天DEMO:

== 服务器到期,预览不了了。请部署到本地自行预览,谢谢!==

如何运行?

1.先将client目录放置在您的web服务器下,打开client/static/js/init.js 文件,将该文件的配置修改成自己的域名或者IP

2.打开server目录,首先将rooms目录以及其子目录权限设为777,确保该目录可写。将client/uploads目录设置为777可写。

3.修改server/config.inc.php 文件。将下面一行代码修改为您的域名或者IP。

define("DOMAIN","http://192.168.56.133:8081");

并且将下面这样修改为rooms目录所在的路径

define('ONLINE_DIR','/mnt/hgfs/swoole/chatroom/rooms/');

4.命令行执行 :

/usr/local/php/bin/php /path/server/hsw_server.php

资料说明

swoole官网 http://www.swoole.com

程序聊天界面采用 钉钉 http://dingtalk.com

前端使用插件: 上传图片插件:xlyjs 一个封装好的跨域上传js控件(https://github.com/hellosee/xlyjs

本程序使用的是文件存储。没有测试抗压能力,并且可能存在BUG,切勿用做商业用途。只提供一起学习和讨论。 如果您有问题,欢迎联系 共同学习

swoole-webim-demo's People

Contributors

hellosee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swoole-webim-demo's Issues

php /path/server/hsw_server.php出现报错

本地环境是nginx18 php7.1
部署教程上的php程序没找到,用了/usr/bin/php的,报错如下
wb端显示client正常,但是不能交互
root@debian:/home/swoole-webim/swoole-webim-demo/rooms# /usr/bin/php /home/swoole-webim/swoole-webim-demo/server/hsw_server.php
PHP Fatal error: Uncaught Error: Class 'swoole_websocket_server' not found in /home/swoole-webim/swoole-webim-demo/server/classes/hsw.class.php:6
Stack trace:
#0 /home/swoole-webim/swoole-webim-demo/server/hsw_server.php(12): hsw->__construct()
#1 {main}
thrown in /home/swoole-webim/swoole-webim-demo/server/classes/hsw.class.php on line 6

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.