I just downloaded and ran the very basic Node.js chat app:
https://github.com/socketio/chat-example
It is working properly.
The server code is very simple:
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var port = process.env.PORT || 3000;
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
});
io.on('connection', function(socket){
socket.on('chat message', function(msg){
io.emit('chat message', msg);
});
});
http.listen(port, function(){
console.log('listening on *:' + port);
});
Now my question is if is it possible to do something similar with PHP?
I have heard about:
https://github.com/swoole/swoole-src
https://github.com/reactphp/socket
any other framework?
But I don't know if it is a good and stable alternative?
Thanks!