Professional Documents
Culture Documents
js -
Websockets
Emerging Web Technologies
Mohawk College
Imagine making something like Slack with PHP (i.e. LAMP stack)
io.on('connection', function(socket) {
socket.on('chat message', function(msg){
io.emit('chat message', msg); });});
• Socket.io package:
• https://www.npmjs.com/package/socket.io
• Start with npm install socket.io
Let's go over some examples!
• See WebsocketExamples.zip on MyCanvas
• Chat example