Websocket chat room written in PHP based on workerman.

Overview

workerman-chat

基于workerman的GatewayWorker框架开发的一款高性能支持分布式部署的聊天室系统。

GatewayWorker框架文档:http://www.workerman.net/gatewaydoc/

特性

  • 使用websocket协议
  • 多浏览器支持(浏览器支持html5或者flash任意一种即可)
  • 多房间支持
  • 私聊支持
  • 掉线自动重连
  • 微博图片自动解析
  • 聊天内容支持微博表情
  • 支持多服务器部署
  • 业务逻辑全部在一个文件中,快速入门可以参考这个文件Applications/Chat/Event.php

下载安装

1、git clone https://github.com/walkor/workerman-chat

2、composer install

启动停止(Linux系统)

以debug方式启动
php start.php start

以daemon方式启动
php start.php start -d

启动(windows系统)

双击start_for_win.bat

注意:
windows系统下无法使用 stop reload status 等命令
如果无法打开页面请尝试关闭服务器防火墙

测试

浏览器访问 http://服务器ip或域:55151,例如http://127.0.0.1:55151

更多请访问www.workerman.net

Comments
  • Problem for 100+ online user

    Problem for 100+ online user

    Hello I install and run https://github.com/walkor/workerman-chat on my server with 40GB RAM , CENTOS , 8 CORE CPU 1.8 GHz , PHP 7 and Libev installed

    After I have only 150 online user , workerman cannot handle messages , sometime a message send after 5 -10 seconds , sometime lost

    1- Where is problem? How can I handle at least 100,000 online user? 150 user for this server is not good 2- How much user I can handle with workerman? in this server?

    opened by sm2017 15
  • Can I run chat on https server?

    Can I run chat on https server?

    I changed this part in index.html: ws = new WebSocket("wss://"+document.domain+":7272"); and enable ssl in start_gateway.php

    $context = array(
        'ssl' => array(
            'local_cert' => __DIR__ . '/path',
            'local_pk'   => __DIR__ . '/path'        
        )
    );
    
    // gateway process
    $gateway = new Gateway("Websocket://0.0.0.0:7272", $context);
    $gateway->transport = 'ssl';
    

    Get following error: Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca in /home/orgjvpwd/public_html/user_account/video-server/vendor/workerman/workerman/Connection/TcpConnection.php on line 391

    SSL Handshake fail.

    question 
    opened by MaksimDzhangirov 6
  • workerman-chat not run

    workerman-chat not run

    [root@iZbp126k55rdoydke33zdtZ workerman-chat]# php start.php kill Workerman[start.php] kill Workerman[start.php] not run [root@iZbp126k55rdoydke33zdtZ workerman-chat]# php start.php kill Workerman[start.php] kill Workerman[start.php] not run [root@iZbp126k55rdoydke33zdtZ workerman-chat]# php start.php start -d Workerman[start.php] start in DAEMON mode [root@iZbp126k55rdoydke33zdtZ workerman-chat]# php start.php status Workerman[start.php] status Workerman[start.php] not run

    excuse me, why?

    opened by arashilan 1
  • Local communication protocol

    Local communication protocol

    How can I use AF_UNIX (unix://) for gateway and business worker communications?

    In case of Distributed Deployment , how can I config gateways that only connect to local business workers?

    opened by sm2017 1
  • windows 環境執行問題

    windows 環境執行問題

    我執行start_for_win 發現錯誤代碼

    Fatal error: require_once(): Failed opening required 'E:\GITHUB\workerman-chat\Applications\Chat/../../vendor/autoload.php'

    而clone下的檔案並沒有autoload 請問該如何解決

    opened by liulance0515 1
  • linux发布还需要额外配置啥嘛

    linux发布还需要额外配置啥嘛

    Workerman version:4.0.22          PHP version:7.2.34
    ----------------------------------------------- WORKERS ------------------------------------------------
    proto   user            worker                listen                      processes    status           
    tcp     root            ChatBusinessWorker    none                        4             [OK]            
    tcp     root            ChatGateway           websocket://0.0.0.0:7272    4             [OK]            
    tcp     root            Register              text://0.0.0.0:1236         1             [OK]            
    tcp     root            none                  http://0.0.0.0:55151        2             [OK] 
    

    启动ok的,但是用ip+端口访问打不开

    opened by clms2 1
This repository demonstrates exemplary implementation of chat using HTTP and Websocket servers in PHP using Kraken Framework components.

This repository demonstrates exemplary implementation of chat using HTTP and Websocket servers in PHP using Kraken Framework components.

Kraken 48 Aug 11, 2021
A PHP Chat based on LE CHAT

General Information: This is a PHP Chat based on LE CHAT v.1.14. An up-to-date copy of this script can be downloaded at https://github.com/DanWin/le-c

Daniel Winzen 137 Dec 17, 2022
一个支持在 Swoole 或其它非 Workerman 环境,开发 Gateway Worker 的组件。

Workerman Gateway SDK 一个支持在 Swoole 或其它非 Workerman 环境,开发 Gateway Worker 的组件。 支持用 Workerman Gateway 做网关,Swoole 编写业务代码。 安装 composer require yurunsoft/wor

Yurun 6 Nov 18, 2022
Asynchronous WebSocket client

Pawl An asynchronous WebSocket client in PHP Install via composer: composer require ratchet/pawl Usage Pawl as a standalone app: Connect to an echo s

Ratchet 528 Dec 15, 2022
Web Based Chat Application For Students, Developers, Learners

Web Based Chat Application Motive of this chat Application is to connect similar interest students closer. Many students faces difficulties to solve t

Aman Tamboli 4 Nov 4, 2022
A framework agnostic PHP library to build chat bots

BotMan If you want to learn how to create reusable PHP packages yourself, take a look at my upcoming PHP Package Development video course. About BotMa

BotMan 5.8k Jan 1, 2023
Aplicación de chat usando HTML, CSS, PHP, JS and MySQL.

SYSTEMSGT Codigo fuente de aplicación CHAT - SYSTEMSGT Lenguajes HTML CSS PHP JS MySQL Pre-requisitos ?? Para poder utilizar esta aplicación necesitas

SYSTEMSGT 36 Dec 1, 2022
Simple custom chat bot developing framework for telegram, qq and more in PHP (the best language)

RinoBot RinoBot 是一个为统一聊天机器人扩展开发的框架,编写一份插件用于多种机器人协议。 简体中文 | English ?? 开发中 ?? 暂不适用于生产环境 特性 插件扩展机制 一份代码运行于多平台多协议机器人 并减小开发难度 插件提供 Yaml 配置 供使用者修改 基于机器人 We

LixWorth 3 Apr 18, 2022
You have just downloaded "Messenger-app" [A lightweight, minimalistic real-time chat application]

MESSENGER-APP You have just downloaded "Messenger-app" [A lightweight, minimalistic real-time chat application] Setup To get it working, follow these

Chr1st0ph3r SAB 1 Oct 29, 2021
crm_chatbot is an app which allows to create a chat for websites.

CRM Chatbot This app could be installed only in the Midrub CMS version 0.0.8.5+. In older versions it will break anything. DEMO VIDEO: https://youtu.b

null 2 Oct 27, 2022
Live chat with several people.

chat What can you do on this application? you can create an account you can talk live with several people you can edit any information on your account

Narcis Lazar 8 Nov 10, 2022
Chat over your local network: 127.0.0.1

#Howto: install packages: apache2 (or nginx but I wouldn't prefer it if you're using your local computer) php for ubuntu/debian instance: $ apt instal

Omer Erbilgin 1 Jan 12, 2022
A simple pocketmine plugin to chat by worlds on your server!

WorldChat Fix Per World Chat plugin for PocketMine-MP API 4.0 Category PocketMine-MP plugins | Php 8 Requirements PocketMine-MP API 4.0.0 and PHP 8 or

HenryDevMaster 7 Nov 2, 2022
The best profanity filter for chat with api for plugin developers!

xqwtxon/ProfanityFilter is moving on ReinfyTeam/ProfanityFilter ProfanityFilter ?? A best profanity filter for pocketmine. Controls hate speech and bl

Ace Sobremont 4 Jul 11, 2022
PocketMine-MP To Discord Chat Logging.

Welcome To PocketCord PocketCord is a PocketMine-MP plugin designed to link discord and your PocketMine-MP Server with quick and easy setup! Installat

null 2 Sep 15, 2022
A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

null 272 Dec 22, 2022
A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

null 258 Sep 15, 2022
A multithreaded application server for PHP, written in PHP.

appserver.io, a PHP application server This is the main repository for the appserver.io project. What is appserver.io appserver.io is a multithreaded

appserver.io 951 Dec 25, 2022
A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch screens with a resolution of 1024x600 connected to a Raspberry Pi.

EDStatusPanel A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch scr

marcus-s 24 Oct 4, 2022