Real-time sockets are so awesome. I love how it's all built around the publish and subscribe pattern too. So easy to follow along. Awesome tutorial, thanks!
This is exactly what I needed man, thanks! I've been trying to use arduino with johnny-five and web sockets for a while to be able to change the color of an rgb led from my phone, and this has helped a ton in seeing how web sockets work. Awesome content!
This worked for me, my client asked to implement a chatroom as minor feature within the app, I didn’t want to invest too much time in this. With a few more adjustments I implemented also rich text and sending pictures. The most boring part was implementing within the front end, I wanted a bubble layout (like WhatsApp) and with tailwind css it’s not immediate to achieve.
Mat Stacy basically a description of a live football (or any other sports) game. So fe when someone scores you‘ll get a message like „X scored. Current score: 2:1“ or smth like that
Hey nice channel, I like the way you explain programming and how clear you manage the information, will you extend this topic using a different app, not a chat, mb a real time post update or a new DM receive??
Thank you! I do want to expand upon the idea of web sockets and real-time communication since I think it is fun to work with an really useful. I right now do not have any project ideas for such a project, but I am sure I will come up with one eventually.
*EDIT:* I have solved the issue. He npm installed a deprecated version of socket.io (2.20) so it seems this code no longer works with the latest version (4.1.1) Will have to consult the socket.io docs to complete this project. Edit 2: Still no luck getting socket.io v4. to work. *The problem* At 6:30 I do not get the socket.emit to log "hello world" in the console, so the socket wasn't working right. Finally I tried copying his github code and the app doesn't work (you an only see your own chats.) So I thought it might be different syntax for sockets 4.0 and above and we need to consult the docs, or install an old version of socket.io. Then I confirmed that version 2.20 prints hello world to the console. *tldr:* He installed socket.io 2.20. The current version is above 4.1.1 and this code won't work right with the new version.
To make it work with latest version of socket.io ^4.1.2 : 1- in server.js change const io = require('socket.io')(3000) to const io = require("socket.io")(3000, { cors: { origin: "*", }, }); 2- in Visual studio code setup live server extension, then open index.html in VS Code and right click inside the page then choose open with live server, this will make the page open in port 5500 or any available port
I need answers for the following questions, can you please answer this (1) Did you observe how it became INSTANT messaging? Is browser client making so many frequent calls to backend to get instant messages? If so, it will be a huge traffic onto the backend server with heavy load. Is this what happening? I am verifying whether you understood the concept, Pavan. (2) Did you try having two different groups having the chat at the same with total isolation from each other? That means you and Varma can have one. On the same server, at the same time, me and another person can have the chatting too. (3) And it should be persisted in database so that it can be always visible when they come back some other day and continue chatting.
Hey Kyle what a great video. I have a running Apache server and a Mysql server running from scratch. Now I want to hook up my Database to this chat server. Then I will have 3 ports all doing something important. LOL I love a challenge.
I have implemented my messaing service using you tutorial thanks alot!! I have a blocker though, I'm trying to create a channel where in a master user can send the message to multiple selected users. I'm not sure how I can create a dynamic channel and listen to it only for the user whom the master user sends the message
Thank you so much for this. Please make a tutorial video showing how we can create PWA chat app ? Great work dude! I speak for all newbies out there when i say... THANK YOU!
i watch all your videos. i searched the net for a language that fits me all over the year at free. finally i find yours. i learnt express.js ejs and rest api by following your videos of course reactjs
That's really nice and well explained! You got it straight to the point. My only question is - do you run this over Express server? you browse localhost:5000 yet the IO variable gets the 3000 port as a parameter. This is something you didn't explain.
I am newbie to node..can anyone just explain how tat Live 5500 port created and code for tat not shown here rite..by the way rest of the code r just awesome 👏
Great video! after scrolling the comments to see you are using live-server i now seem to be getting lots of CORS errors in the terminal when trying to run in browser
Please create a tutorial a chat system with a database using MySQL and node.js. With just particular user you wanted to chat. AWESOME TUTORIAL BY THE WAY!!!!!!!!!!!!!!
Brilliant!! You saved my life I was looking for a tutorial that shows how to upload files or pictures in a real time chat app? Do you have any basics ideas of how we can do it or any resources? Thanks a lot.
Can you please explain the address bar "127.0.01:5500/index.html", that would be helpful." Like where exactly you have kept your (index.html) file/s. And directory structure of the same.
I encountered an error before, and the error is 'io is not defined'. What I did is I change the arrow function in my server.js file into an es5 function which is io.on('connection', function(socket){ socket.emit('Chat Message', 'hello Socket'); }); and it worked!
I can not see "Hello world!" on the console :( I also don' t get an error I get this in issues.: "Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute"