Socket.io Beginner Tutorial - NodeJS + ExpressJS

Поділитися
Вставка
  • Опубліковано 28 гру 2024

КОМЕНТАРІ •

  • @khangnguyen5538
    @khangnguyen5538 2 роки тому +2

    My boy really made it quick and easy. Thanks, man.

  • @17Tanner171
    @17Tanner171 3 роки тому +2

    you are a blessing to humanity

  • @sertansantos3032
    @sertansantos3032 2 роки тому +1

    I love you first tutorial that made me UNDERSTAND IT

  • @tens0r884
    @tens0r884 2 роки тому

    Every few months I have a new tech to learn for whatever project, and every few months my search for answers inevitably leads back me to you. Like that thanos quote

  • @realworldcodingapplications

    watched a bunch of vid coverin the same topic,and actually got client side to work ! whoop tanks for tutorral

  • @tusimegodwin283
    @tusimegodwin283 3 роки тому +5

    Going back to the documentation after watching this video, the get started part makes sense now. Thanks a lot

  • @Retrocaus
    @Retrocaus 3 роки тому +1

    you're a chad bro, their documentation was so confusing

  • @shahadatsadhin2849
    @shahadatsadhin2849 3 роки тому +2

    thank you very much I was facing the cors issue before I saw your video😁

  • @ThColinPereira
    @ThColinPereira 3 роки тому +1

    absolute banger, thanks pedroski

  • @CySA28
    @CySA28 3 роки тому

    i have a problem with user connection. when i start the server it doesn't show the User connection id on terminal 13:28

    • @aw1lt
      @aw1lt 3 роки тому

      same here. did you figure it out?

  • @SahityaMahaSagarr
    @SahityaMahaSagarr 3 роки тому +1

    I wanted to live update my game scoreboard now I can by watching this video , thanks !

  • @habib4097
    @habib4097 4 роки тому +2

    Thank you... waiting for your complete chat application tutorial based on React & Node

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому +1

      Hey, I actually already have a two video series showing how to do this: ua-cam.com/video/XS79S6nmaGM/v-deo.html The thing is that the code doesn't work for socket.io current version, but it works for the version 2.3.0 which was the last!

  • @tricoliciandrei7842
    @tricoliciandrei7842 Рік тому

    Golden Man, oh my god. Thank you !

  • @thiagogregory1
    @thiagogregory1 4 роки тому +1

    I liked and subbed because you went to school I'm (probably) attending next year here in Brazil. Hope you're doing well there in Canada btw!

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому +1

      Awesome! Thanks! So you are you going to study at PASB or UBC?

  • @mandeepdaksh376
    @mandeepdaksh376 3 роки тому +1

    Amazing tutorial it was. Seamless, clear, and to the point. 👌😊

  • @romimaximus
    @romimaximus 4 роки тому +1

    another great tutorial..!!! thankx pedro..👍😎

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому +1

      Glad you liked it!

    • @romimaximus
      @romimaximus 4 роки тому +1

      @@PedroTechnologies im just having a hard time connecting the frontend to server, cause the server is refusing my frontend connection..!!! rsss...and is returning a 404 Error...I installed "cors", changed the port number, changed the "socket.io" CDN, but nothing seems to work..!!

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому +1

      @@romimaximus some people had this issue too, i will research more on the topic. Im certain that if u downgrade ur socketio version to 2.3 it works, but there most be a way to fix this issue

    • @romimaximus
      @romimaximus 4 роки тому

      @@PedroTechnologies now my server code like this:
      const express = require('express');
      const morgan = require('morgan');
      const app = express();
      const socket = require('socket.io');
      app.set('view engine','ejs');
      app.use(morgan('dev'));
      // @route 'localhost:5000/index'
      app.get('/index', (req,res) => {
      res.render('index');
      });
      const port = process.env.PORT || 5000;
      const server = app.listen(port, () => {
      console.log(`Server running on port localhost:${port}`);
      });
      // CREATE SOCKET
      const io = socket(server);
      //SOCKET CONECTION
      io.on('connection', (socket) => {
      console.log(`User connected on socket: ${socket.id}`);
      });

    • @romimaximus
      @romimaximus 4 роки тому

      now its working....thankx Pedro...!! 👍

  • @yukaiwu7988
    @yukaiwu7988 2 роки тому

    Thank you man, this video is neat, I learned so much!

  • @BeckettFrey
    @BeckettFrey 2 роки тому

    Nice tutorial helped me out TY!

  • @marimuthumanoj7206
    @marimuthumanoj7206 2 роки тому

    cool, but what that case of the message should appear in also on sender?

  • @dhawalparmar7117
    @dhawalparmar7117 3 роки тому

    Thanx bro , your teaching skill is amazing

  • @maniratnareddy7635
    @maniratnareddy7635 3 роки тому +2

    working fine on localhost but when deployed on heroku its not working...wt changes need to be made?..plz reply

    • @PedroTechnologies
      @PedroTechnologies  3 роки тому +1

      Interesting! Maybe socket.io updated and this caused some issues!

  • @BeDb_MeDb
    @BeDb_MeDb 3 роки тому +1

    Thank you, good luck in your next videos and hi from Russia:-)

  • @expiredlamb2000
    @expiredlamb2000 3 роки тому +3

    Very nicely explained. Now I can finally try to implement some socets into my servers!

  • @Shellflower1234
    @Shellflower1234 4 роки тому +1

    Great video bro!

  • @kapilpandit4676
    @kapilpandit4676 3 роки тому

    I want to store messages in local storage after refreshing how to manage previous messages and I want to add the functionality of creating a new room and add joined users in any room

  • @realkevinbrian
    @realkevinbrian 2 роки тому

    Awesome content Dude, After 5 years I finally understood about Sockets😅

  • @KyouKo-x7g
    @KyouKo-x7g 3 роки тому +1

    thx your teaching a lot , I subscribe you ^^ ~~~~ And I want to ask you ,
    12:26 should I change the http to my domain , in the real website app ???? thx a lot

    • @PedroTechnologies
      @PedroTechnologies  3 роки тому

      Thank youy! Yeah, when u deploy you change it to ur websites url!

    • @aw1lt
      @aw1lt 3 роки тому

      @@PedroTechnologies no, thank _youy_

  • @aniruddhmishra6182
    @aniruddhmishra6182 2 роки тому

    You nailed it brother awesome to-the-point explanation .....the best beginner video for socket io i ve seen

  • @haiquanzheng5224
    @haiquanzheng5224 3 роки тому +1

    great video!!! i was so confused with the on emit process but you made it clear!!

  • @vishakamohan5336
    @vishakamohan5336 3 роки тому +1

    that was helpful, thanks!

  • @adnanqureshi6098
    @adnanqureshi6098 4 роки тому +1

    I ran client and server on two different ports for the backend and frontend. The problem is that cors is not allowing me to use * the wildcard with the credentials set to true, is there a solution for this problem, i have used socket before but never faced such issue

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому

      If you are running the client and server on different ports, you need to install a dependency called cors. Then require it and use it. Example:
      const cors = require('cors')
      app.use(cors())

    • @adnanqureshi6098
      @adnanqureshi6098 4 роки тому

      @@PedroTechnologies I have used it but still got the same error infact before using socket I was already using cors as a middleware on express

  • @mcspraint
    @mcspraint 3 роки тому +1

    Brother...it works on my localhost but doesn't work when I host in on a cloud...plz explain why..and how to fix this...

    • @PedroTechnologies
      @PedroTechnologies  3 роки тому

      Interesting, I don't know why that is happening! Maybe socket io changed!

  • @mananvirmani1243
    @mananvirmani1243 3 роки тому

    Thanks for this tutorial👍🙂!!

  • @apeiron4409
    @apeiron4409 4 роки тому +1

    great tutorial!

  • @gibraanjafar1669
    @gibraanjafar1669 3 роки тому +1

    Well explained Pedro. Thanks for this wonderful explanation

  • @KT-ut9zg
    @KT-ut9zg 3 роки тому +1

    Great tutorial. Clear and quick.

  • @syedmaroofali7259
    @syedmaroofali7259 3 роки тому +1

    what to do if i want to broadcast my message to a specific person(socket id) ?

  • @oranbenavi8105
    @oranbenavi8105 Рік тому

    Great Video Thank you

  • @saitejavasamsetti1302
    @saitejavasamsetti1302 3 роки тому

    sir getting error in html that io is not defined i place cdn in script tag after that iam facing error

  • @ahsanijaz3319
    @ahsanijaz3319 3 роки тому

    Really loved this concise way of teaching...

  • @wing-views
    @wing-views 2 роки тому +2

    Hi Pedro, can you please tell why we need to use the http module with express? I am new to node.

  • @dochimekashiariri7610
    @dochimekashiariri7610 3 роки тому

    This was really good

  • @Leo-es3fq
    @Leo-es3fq 4 роки тому +1

    How can i open dropdown menu like the facebook ? I am a beginner in React

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому +1

      Hey, I can make a video on that! Probably would be nice to use something like MaterialUI or React Bootstrap!

    • @Leo-es3fq
      @Leo-es3fq 4 роки тому

      @@PedroTechnologies I'm looking forward to your video. I'm using tailwind css

  • @srinivaskurikuri9548
    @srinivaskurikuri9548 2 роки тому

    hai bro this one is helpful can u explain more about the events namespaces and all those

  • @genosthegreat7870
    @genosthegreat7870 2 роки тому

    How can i export io to other files?
    Please reply pedro😁😄

  • @ezequielaguilera130
    @ezequielaguilera130 3 роки тому

    Excelent video thanks!

  • @sameeryadav4333
    @sameeryadav4333 3 роки тому

    best channel for web dev, i like your easy and detailed explanations which are very helpful for beginners :)

  • @yourjdr
    @yourjdr 3 роки тому

    Make a vedio calling website like zoom without using react js ( or can you do that )

  • @f3-faithfitnessfinance
    @f3-faithfitnessfinance 4 роки тому +2

    3000🙌 amazing man🔥

  • @codexyz97
    @codexyz97 3 роки тому +1

    yes socket io v3 causes issues if you dont set a cors

    • @PedroTechnologies
      @PedroTechnologies  3 роки тому +1

      Yes! That made many of my projects outdated, just have to manually set cors for them!

  • @kalculata555
    @kalculata555 Рік тому

    Amazing videos,

  • @Euquila
    @Euquila 3 роки тому +1

    You are amazing.

  • @krishnajamdhade27257
    @krishnajamdhade27257 3 роки тому

    Thank a lot brother

  • @tenureofapps989
    @tenureofapps989 3 роки тому

    Could you please make Restful API's tutorial also?

  • @TheCodingOdyssey
    @TheCodingOdyssey 4 роки тому +1

    Hey bro! Did you have a good Christmas?

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому

      Yeah bro! Wby? I couldn't even celebrate that much cause of covid and Im studying like crazy for an interview.

    • @TheCodingOdyssey
      @TheCodingOdyssey 4 роки тому

      @@PedroTechnologies Just asking mate! Sorry to hear mate, hope you could at least see your family. I am sure you will crush that interview!

  • @sudheshanaK
    @sudheshanaK 3 роки тому

    Great video

  • @srujanvemula7973
    @srujanvemula7973 2 роки тому +1

    good video broo

  • @admirdizdarevic7752
    @admirdizdarevic7752 4 роки тому +4

    Hi Pedro. Another great video! Keep it up! I was wondering, can you make a video about Role based access control in react js. It would be very usefull i think.

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому +1

      Thank you! I have a video on that using react express and mysql, but I plan on making another one. Here is the video if u are interested: ua-cam.com/video/YLihWZwLaGU/v-deo.html

    • @admirdizdarevic7752
      @admirdizdarevic7752 4 роки тому

      Thank you! I have watched that one and it help me a lot :D. I was thinking about how can i make that only admin can do registration for example so to specifie if one role can do somth. And that one video really help mee understating some things. Big thanks! You are really great.

  • @ThColinPereira
    @ThColinPereira 3 роки тому +1

    do you have a udemy course? i'd totally buy it!

  • @bassguitarist2686
    @bassguitarist2686 Рік тому

    Thank you!

  • @dalandan8300
    @dalandan8300 2 роки тому

    I followed this one step by step but mine is not updating realtime.

  • @gurvirbaraich2028
    @gurvirbaraich2028 3 роки тому +1

    Thanks!

  • @pastasawce
    @pastasawce 3 роки тому

    How can I use socket.io with webpack?

  • @shawngardiner2604
    @shawngardiner2604 3 роки тому

    Very Nice!

  • @taihatranduc8613
    @taihatranduc8613 3 роки тому +1

    you are so good

  • @introvert_Amit
    @introvert_Amit 2 роки тому

    please make a video chat app tutorial

  • @zoejmc6230
    @zoejmc6230 9 місяців тому

    bro THANK YOU

  • @saf_web_genie
    @saf_web_genie Рік тому

    guys nodemon is no longer required after version 18.11 you can use the --watch option

  • @usmanmughal5916
    @usmanmughal5916 4 роки тому +1

    @PedroTech u planning on getting a job?

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому +1

      I have a part time job rn, but I am looking for summer internships. I have an interview next week and if all goes well I will accept that one. But Im still in my second year of university so im not looking for anything full time

    • @usmanmughal5916
      @usmanmughal5916 4 роки тому +2

      @@PedroTechnologies I wish u get the internship but I hope u will not stop making video.

    • @PedroTechnologies
      @PedroTechnologies  4 роки тому +2

      @@usmanmughal5916 Hahaha no worries! This semester proved to me how much work I can handle at the same time. And since the internship will be during the summer I won't be taking classes. I will structure my day to devote 100% of my time to the internship during the 8 hour shift, then at night I will make videos for the next day!

  • @rufus9322
    @rufus9322 2 роки тому

    very helpful

  • @ccaiuss
    @ccaiuss 3 роки тому

    Nobady toalks about security, login ... i cant use express whitout security !

  • @Jeridi
    @Jeridi 2 роки тому

    why .ejs ?

  • @random2059
    @random2059 Рік тому

    Please reply 🙏🙏🙏🙏🙏
    😢😢😢😢😢😢 please 🙏🙏🙏🙏🙏
    it's very important for my interview
    ......
    why to use low level module like 'http' , when we already have modern 'express'
    , what special inside 'http' module that express can't provide.
    I also saw a stack overflow question pending in this topic
    Please 🙏🙏🙏🙏🙏 reply any body I just need a strong right information 🙏🙏🙏

  • @cyberking4650
    @cyberking4650 3 роки тому

    i need this code

  • @itshyzen
    @itshyzen 3 роки тому +1

    Nice.

  • @ravi6996
    @ravi6996 3 роки тому +1

    Bruh 👌👌

  • @АртёмРусалеев-ж2ь
    @АртёмРусалеев-ж2ь 4 роки тому +1

    Thank from Russa

  • @aniruddhmishra6182
    @aniruddhmishra6182 2 роки тому

    i love you bro

  • @mod7ex_fx
    @mod7ex_fx 3 роки тому

    1111111111111111111111%

  • @rushrush6754
    @rushrush6754 2 роки тому

    Lol this guy reuse the same project a thousand times for every videos.
    So typical of programmers, like what did you do with those seconds saved?

    • @PedroTechnologies
      @PedroTechnologies  2 роки тому

      I never repeat the same tutorial, but I do repeat projects if they are useful for a certain topic. I have a chat app vid using react and this one using vanilla js. This are both targeted for 2 audiences, so I don't see why it would be a problem.

    • @rushrush6754
      @rushrush6754 2 роки тому

      @@PedroTechnologies give back my comment the heart you removed else I will unsubscribe lol

    • @PedroTechnologies
      @PedroTechnologies  2 роки тому +1

      @@rushrush6754 i gave it as an accident hahaha i like constructive comments like urs but i use the heart for when i agree with the comment.

  • @1Chitus
    @1Chitus Рік тому +1

    Thanx bro , your teaching skill is amazing

  • @easywebdevelopment
    @easywebdevelopment 3 роки тому +1

    Amazing tutorial it was. Seamless, clear, and to the point. 👌😊