Code Monkey home page Code Monkey logo

codeigniter-ratchet-websocket's Introduction

CodeIgniter-Ratchet-Websocket

This library contains the demo of commenting/posting realtime using CodeIgniter-Ratchet-Websocket with AngularJS as client-side javascript framwork.

There is no rocket science I have done to achieve this.

As you know the CodeIgniter Directory Structure

There is a folder called CI- -application -third_party -Realtime (I put here Ratchet PHP Websocket Library)

I put my code here and just call that code using Javascript websocket.

How to use :

  1. Download the code.

  2. You got a database script with name "realtime.sql", just import that script into your database named "realtime" (You may use your name but you have to change database name in CodeIgniter's database.php also.

  3. Put the downloaded code in your web root folder (www or htdocs... whatever it may be).

  4. Goto application/config/constants.php

Change the constant BROADCAST_URL and set it as IP of your own computer.

  1. Open Command Prompt Move towards your webroot folder. We are having our websocket code at following path in our project.
application/third_party/Realtime/bin/server.php

We have to run that server.php file from command prompt.

Just move to that folder by using "cd" command.

c:/>cd xampp/htdocs/ci-ratchet/application/third_party/Realtime/bin

Press enter.. Now you are in that directory specifically, just run following command.

c:/>php server.php

If its error free and noting is populated, then its supposed that you got the success to start the websocket server.

  1. Now run your ci-ratchet project in browser by hitting url.
http://localhost/ci-ratchet/

Once AngularJS initialize, you can see the Textbox, just start typing and press enter.... VOLLAAAAAAAAA

Its working

  1. Check it in another browser for realtime experience.

What I used?

  1. CodeIgniter 3.x PHP Framework (https://www.codeigniter.com/)

  2. Ratchet - Websocket for PHP (http://socketo.me/) by Chris Boden(@boden_c)

  3. AngularJS - A superheroic Javascript MVW Framework by Google

codeigniter-ratchet-websocket's People

Contributors

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