GithubHelp home page GithubHelp logo

rioastamal-examples / collaborative-editor-websocket-php Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 9 KB

Simple collaborative editor over WebSocket using Ratchet PHP

PHP 53.99% HTML 46.01%
websocket php editor tutorial

collaborative-editor-websocket-php's Introduction

About

This repository are intended for learning purpose only. A simple collaborative editor over WebSocket using Ratchet PHP library. It features very simple editor and preview window for previewing HTML content.

Demo Collaborative Editor WebSocket PHP

Installation

Clone this project repository.

$ git clone https://github.com/rioastamal-examples/collaborative-editor-websocket-php

Next is to install all dependencies required by chat server using Composer.

$ cd collaborative-editor-websocket-php
$ composer install -vvv

Running the App

We need to start two server first is the web socket server and second is normal web server. To start web socket server you can execute a script on ./bin directory.

$ php ./bin/editor-server.php
Websocket Editor server running on 0.0.0.0:9191.
--

Now open another terminal and start web server using PHP built-in web server. The document root should be public/ directory.

$ php -S 0.0.0.0:9190 -t public/
PHP 7.1.25 Development Server started at Wed Jan  9 06:10:13 2019
Listening on http://0.0.0.0:9190
Document root is /path/to/collaborative-editor-websocket-php/public
Press Ctrl-C to quit.

On example above by default the web server is running on port 9190 and web socket server on port 9191. Here's step to test.

  1. Open your browser and navigate to http://localhost:9190/.
  2. Open another tab or browser window and navigate to the same address.
  3. Start typing on Editor box, the code should be appear on another window.

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.