Code Monkey home page Code Monkey logo

nomanyousaf1658 / socket-base-php-realtime-chat-application Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5 KB

Create a simple php chat application using WebSocket and PHP socket programming. The WebSocket is used to create a bridge to send or receive messages from the PHP chat server. In the web world, we generally use HTTP request methods to communicate between the client and server side. In this application, we use socket to communicate with the server, For establishing a socket connection between the client and the server, we use the WebSocket protocol (ws://) to specify the address of the PHP page where the WebSocket handshake is handled. After creating WebSocket there are callbacks to handle the events that occur between the client and the server during the chat process.

PHP 100.00%

socket-base-php-realtime-chat-application's Introduction

Socket-Base-PHP-Realtime-Chat-Application

Create a simple php chat application using WebSocket and PHP socket programming. The WebSocket is used to create a bridge to send or receive messages from the PHP chat server. In the web world, we generally use HTTP request methods to communicate between the client and server side. In this application, we use socket to communicate with the server, For establishing a socket connection between the client and the server, we use the WebSocket protocol (ws://) to specify the address of the PHP page where the WebSocket handshake is handled. After creating WebSocket there are callbacks to handle the events that occur between the client and the server during the chat process.

Installation

To install the application please follow bellow steps one by one.

  • Clone project repo.

  • Make sure socket "ws" url is right as per your host Url, Mine for localhost is (ws://localhost:8090/Socket-Base-PHP-Realtime-Chat-Application/inc/php-socket.php) you can change that into index.php file easily.

  • Make Sure PHP CLI is setup to your machine, specially if you are using Windows.

  • Open Command prompt(CMD) and Run php -q PATH_TO_YOUR_PROJECT_DIRECTORY and php-socket.php FILE

  • For my case i run command php -q /g/xampp/htdocs/Socket-Base-PHP-Realtime-Chat-Application/inc/php-socket.php (You can run accordingly).

  • Boom you can open multiple browser windows and can test.

socket-base-php-realtime-chat-application's People

Contributors

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