Giter Club home page Giter Club logo

webim's Introduction

WebIM

基于Swoole-WebSocket的多人在线聊天


2018-04-26更新 增加WebSocketClient相关,使

PHP进程可以创建一个websocket客户端与WebSocket服务器通信,发送消息转发的指令。

使用方法为

  1. 在终端运行Socket.php
  2. 在浏览器中运行Socket.html
  3. 浏览器中SocketClient.php

本机运行环境如下:

  • PHP 7.1.7
  • Redis 3.1.0
  • Swoole 2.1.3
  • 集成环境为LNMP1.4.1
  • 支持WebSocket的浏览器

使用方法

  • 确保PHP拓展Redis,Swoole在php.ini中全部开启
  • git clone 项目到本地
  • 进入项目根目录WebIm,终端运行php Socket.php,保持窗口打开,不要关闭
  • 打开谷歌浏览器,找到项目,例如: http://localhost/WebIm/Socket.html
  • 当项目第二行出现hello,welcome,即表示链接成功;如果没有出现,表示链接服务器失败
  • 同理,可以查看运行中的终端

PS. 这个版本真的是超级简易版,有很多问题。

  • 目前采用的是Redis存储上下线用户
  • 聊天数据没有存储
  • 单页面重复刷新,会出现WARNING swManager_check_exit_status: worker#1 abnormal exit, status=0, signal=11这个Warning,并且无法新增用户,目前没有找到解决办法
  • 界面丑
  • 目前无法识别是不是自己发出的消息

总体只能说是一个Demo,可以在这个基础上大力开发。

webim's People

Contributors

ouhaohan avatar ouhaohan8023 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.