Node.js & Socket.io Chat Part One: The Basics

Smitha · 187K views · 2013 · 18:34

Open on YouTube

Web developmentPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as a ready-made beginner tutorial for real-time chat with Node.js and Socket.io, and many askers cite it as the code they followed when something broke.

Recommended by 3 people across 3 different months, 2013 to 2016.

What it is

A screencast by Smitha that walks through building a basic chat application with Node.js, Socket.io and Express in about 18 minutes. It is the first part of a series, with downloadable code and a follow-up video.

What people said

Recommends StaleMartyr · 2013-10 · Stack Overflow · on “Synchronize Javascript Timer”

If you are using javascript/using node.js...you can use websockets to synchronize your timers in real time. here is a link to a good tutorial :-) [this video]

Recommends Idkt · 2014-03 · Stack Overflow · on “how to notify javascript that something happened in database”

@user3179928 just a bit of googling: [this video] this can get you up and running! There's no better way to learn new stuff than by building something with it!

Recommends mellows · 2016-05 · Stack Overflow · on “socket.io troubles - 404 (Not Found)”

Despite following the exact instructions of this video: [this video] and changing details where necessary (e.g. I am using localhost:8888 as oppose to 3000), I am always getting error messages, no matter what I try. It is becoming extremely frustrating as I can't, for the life of me, figure out where I am going wrong. I am currently getting the error message GET [LINK] 404 (Not Found) after a massive struggle of continuously getting an error where it couldn't locate the 'socket.io.js' file. Can anyone shed some light on this devastatingly cryptic topic? HTML: <html> <head> <title>Chat with socket.io and node.js</title> <style> #chat{ height:500px; } </style> </head> <body> <div id="chat"></div> <

Cites whitesiroi · 2013-10 · Stack Overflow · on “node.js + nginx + rails Chat does work on localhost, doesn't work on Amazon EC2”

Chat does work on localhost, doesn't work on Amazon EC2 index.html <html> <head> <title> Chat with socket.io and node.js</title> <style> #chat { height:500px; } </style> <head> <body> <h1 style="text-align:center;">CHAT</h1> <div id="chat"></div> <form id="send-message"> <input size="35" id="message"></input> <input type="submit"></input> </form> <script src=" [LINK] "></script> <script src="/socket.io/socket.io.js"></script> <script> $(function(){ var socket = io.connect(); var $messageForm = $('#send-message'); var $messageBox = $('#message'); var $chat = $('#chat'); $messageForm.submit(function(e){ e.preventDefault(); socket.emit('send message', $messageBox.val()); $messageBox.val(''); })

Cites Misha · 2014-05 · Stack Overflow · on “LAMP With NodeJS and Socket IO”

I developed web site with LAMP, where I need users to chat with each other, make group chat or PM. I googled the solution and found that the best way to create chat/messaging application is NodeJS & SocketIO. I wrote small chat client/server application with Node and Socket. But I have a problem, Node JS runs on another port, because has own server and does not need apache, but my goal is to integrate Chat application with my web site, in short, i want my chat to run with apache 80 port (inside www root folder). I used this tutorial on youtube [this video]

Cites user3554151 · 2015-02 · Stack Overflow · on “Socket.IO Chat not sending and/or recieving messages”

I have followed a tutorial for socket.io chat: [this video] In the tutorial video it works fine however mine does not work at all. The messages do not seem to be sent or received by either the server or the client This is my app.js run on the server side with node var express = require('express'), app = express(), server = require('http').createServer(app), io = require('socket.io').listen(server); server.listen(3000); app.get('/', function(req, res) { res.sendfile(__dirname + '/index.html'); }); io.sockets.on('connection', function(socket) { socket.on('send message', function(data) { io.sockets.emit('new message', data); }); }); This is my index.html client <html> <head> <title>Chat with socket.

Cites Mark Hill · 2015-06 · Stack Overflow · on “best way to update chat room quickly, and reliably?”

From what I can tell you have the general understanding of how the scripts work, and the overall general concept of what you want to do. Which is good. As far as making your application faster. There's not a whole lot that can be done there with the way it is currently built. The best you can do is look at the speed of any loops you have and check that they are not too in depth as that can overclock processes and decrease the speed at which data is retrieved from the server. JSF Methods I have been researching JSF (JavaServer Faces), which is a J2EE framework for server based applciations. It implements CSS, HTML, and various components of other languages and from what I can tell is extremel

Cites ryan mann · 2016-01 · Stack Overflow · on “Difficulties in making a chat app with node.js and socket.io”

I started to watch this video [this video] , where this programmer, shows step by step a very basic chat app. My problems start when I'm trying to execute the "npm install" command. I get the following message: enter image description here [LINK] I am doing everything the same as in the video.