GithubHelp home page GithubHelp logo

dimabory / ws-chat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evgeniir/ws-chat

0.0 1.0 0.0 159 KB

Online chat on websocket using Swoole (https://www.swoole.co.uk/)

PHP 95.73% CSS 0.12% Hack 0.84% JavaScript 3.31%

ws-chat's Introduction

Online chat on websocket using Swoole (https://www.swoole.co.uk/) Working example here: http://62.109.21.96/

For using on local machine:

  1. pecl install swoole
  2. Create MySQL database "ws-chat" and create table messages. SQL code:

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00";

CREATE TABLE messages ( id int(11) NOT NULL, username varchar(100) NOT NULL, message varchar(2000) NOT NULL, date_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE messages ADD PRIMARY KEY (id);

ALTER TABLE messages MODIFY id int(11) NOT NULL AUTO_INCREMENT; COMMIT;

  1. mv ws-chat/app/DBConfig.php.sample ws-chat/app/DBConfig.php and configure it.
  2. Configure nginx: https://www.nginx.com/blog/websocket-nginx/
  3. start server:
  • php ws-chat/ws_start_server.php

ws-chat's People

Contributors

evgeniir avatar

Watchers

 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.