Realtime One To One Chat
V2
WebSockets is a bi-directional, full-duplex, persistent connection from a web browser to a server. Once a WebSocket connection is established the connection stays open until the client or server decides to close this connection. With this open connection, the client or server can send a message at any given time to the other. This makes web programming entirely event driven, not (just) user initiated. It is stateful. As well, at this time, a single running server application is aware of all connections, allowing you to communicate with any number of open connections at any given time.
git clone https://github.com/harendra21/Realtime-One-To-One-Chat.git
composer install
socket_id
for the sql given below.src/App/Chat.php
(line 24 to 29).cd bin
php chat-server.php
localhost/path_to_your_folder/public
CREATE TABLE `socket_id` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` varchar(255) DEFAULT NULL,
`socket_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
)