Socket IO Rooms Tutorial (Backend part 1)

Поделиться
HTML-код
  • Опубликовано: 18 окт 2024

Комментарии • 97

  • @thegoodgolly1465
    @thegoodgolly1465 3 года назад +11

    Seriously appreciate this. Idk if you're just on my wavelength but this makes the most sense out of the socket IO and rooms tutorials I've seen so far. You quickly and perfectly explain what you're doing and why you're doing it without going overboard, and even though I'm working on an app that's not the same as the chat you make in this tutorial, I'm actually able to follow along and pick out or edit as needed without losing functionality.

  • @atticus2581
    @atticus2581 2 года назад +5

    Damn, ussualy i speed these things up and had to check I hadnt increased playback speed, this guy talks fast! I like it!

  • @hermitanotherant2930
    @hermitanotherant2930 3 года назад

    Just adding a callback to the original socket message is genius. Far more elegant than having to respond with a whole new message. Thanks!

  • @tahsinalmahi8769
    @tahsinalmahi8769 10 месяцев назад +1

    Great tutorial. Thanks a lot!

  • @p_o_z_e
    @p_o_z_e 8 месяцев назад +1

    This is still such a good video, super useful.

  • @number1neek
    @number1neek 3 года назад +4

    Thanks for the video. Really well explained!
    One bit of constructive criticism though - I like the fast pace but at times it sounds like you're rushing and some words are hard to understand. I had to check I didn't have you set to 1.5x speed lol

  • @chriscalver8595
    @chriscalver8595 Месяц назад

    That was awesome. Love that you speak fast.

  • @serjio8781
    @serjio8781 4 года назад +7

    You've totally nailed this socket io stuff! Looking forward to the client side part :)

    • @CodingWithChaim
      @CodingWithChaim  4 года назад +2

      Thank you! Well I certainly hope the client side part won’t disappoint

  • @VamsiKrishna-yt5hi
    @VamsiKrishna-yt5hi 3 года назад +9

    I think it is not safe for the server to call a function passed by a client. That function could be anything. Moreover, you are revealing to the client that you are using a Javascript backend.

  • @brunobuss7005
    @brunobuss7005 3 года назад

    this guy speaks so fast, i love it

  • @aleksandrmatyka3118
    @aleksandrmatyka3118 2 года назад

    It's the best explanation that I've seen

  • @Whitetail
    @Whitetail 3 года назад +1

    Thank you very much. This is an amazing tutorial, very well explained. You helped me save a lot of time.

  • @christianangelomsulit3759
    @christianangelomsulit3759 3 года назад +2

    Set speed to 0.75 and everything for me is now clear

  • @thelitterateman
    @thelitterateman 3 года назад +12

    slow down bruhh. M here to learn, but you're on a train.

    • @eloy_777
      @eloy_777 3 года назад +1

      You can just watch it slowed to x0.75, the video won't be that longer

  • @sashaikevich
    @sashaikevich Год назад

    1337. What a throwback ! Great pace for your vid. What do you do when you’re not making RUclips vids, got a blog or something I can read?

  • @ozzyfromspace
    @ozzyfromspace 3 года назад +3

    Hey Chaim! This was a magnificent video, thank you so much for putting this beauty together! 🏆🎊🙌🏽
    I'd like to voice an educated guess: the client-side defined callback may be a security risk. I'm thinking that a highly motivated attacker could reverse engineer your build js file and alter the callback to do something malicious, and it will run on your server regardless. That's my immediate thought, but I'll have to watch the next video to see how you do the cb. I read it in the docs a few weeks ago but I didn't understand it then. Do you have an opinion on this?
    Again, phenomenal explanation of the "rooms" concept! 💯😎

  • @jonahg6564
    @jonahg6564 4 года назад +1

    Amazing! Keep the content flowing!

  • @yasteelgungapursat8159
    @yasteelgungapursat8159 2 года назад

    Explanations are on point👌🏻 but damn I thought the video was sped up🤣

  • @mentalmodels5
    @mentalmodels5 3 года назад +5

    10:16 wouldn't that be insecure? Since people can modify the client javascript and execute another function?

    • @williamduncan7401
      @williamduncan7401 3 года назад

      if your function is e.g. `console.log` this will not trigger `console.log` on the server, just on the client. it's literally like emitting a response back containing the function name and arguments and the client calling the function, but it's a built-in thing to save you that client-side code

  • @saadbaig3060
    @saadbaig3060 2 года назад

    Very Well Explained!
    You got a new subscriber,
    Thanks.

  • @GHOST-fe3cu
    @GHOST-fe3cu 2 года назад

    you make my adhd very happy

  • @gurkanucar
    @gurkanucar 2 года назад

    Thanks a lot! By the way, cb(callback) is equal to ack. It may cause confusion because I am applying this in the java spring boot application and I couldn't find anything about the callback. So just i wanted to mention it. Thank you again :)))

  • @prathameshpatil5860
    @prathameshpatil5860 2 года назад

    This is awesome but I have a question if I wanted to remove a user from channel(room) how can I do it??

  • @ikibkilam8383
    @ikibkilam8383 3 года назад +1

    Very cool! Thank you for doing these videos. Btw, I think the link to the code repository for this video is not correct.

  • @ikibkilam8383
    @ikibkilam8383 4 года назад

    Awesome video. Incredibly lucid.

  • @deeperealms
    @deeperealms 3 года назад +1

    Really awesome tutorial!
    I am kind of concerned about the security of letting the client send a callback function to run on the server though. I've just been getting deeper into security, so maybe I'm paranoid, but it seems very vulnerable to some sort of code injection?

  • @ЖукОбычниик
    @ЖукОбычниик 3 года назад +5

    I don't agree with you passing a callback function from the clinet side this is literally the most dangerous thing you can do because hackers

    • @ЖукОбычниик
      @ЖукОбычниик 3 года назад

      @Amir Moeen Rahmani well you see whet he does is he gets a function from the user and executes it on the backend but the user can put whatever malicious code he want in that function with that the hacker can: crash your backend, make a never ending loop preventing the backend from functioning properly, steal all the data he wants, and the list goes on. This dude is legit letting anyone send a function to the backend that will get executed even I with 0 hacking skills could crash his backend

    • @CodingWithChaim
      @CodingWithChaim  3 года назад

      This is the docs from socket.io talking about this approach. socket.io/docs/v3/emitting-events/
      Scroll down to Acknowledgements
      I should also mention that there is no risk here because this is not code that executes user code. A good example where one more worry about executing user code is with the common xss attack. For example, you have a blog, and then you have comments, now a user can make a comment have a script tag and then add their own javascript to this script which will execute on your website. This works because when you render a script tag, the code within executes.
      In this case however, you are not taking user entered data and passing it along to an environment that can execute this code.
      Hope this helps clear things up.

    • @ЖукОбычниик
      @ЖукОбычниик 3 года назад +1

      @@CodingWithChaim But can I not write a regular node script that will connect to the server and emit an event with the malicious function?

    • @mindglimpse559
      @mindglimpse559 Месяц назад

      @@ЖукОбычниик When the server executes the callback provided by the client, it is essentially sending a message back to the client that triggers the client's function. The server does not run the client's code directly.

  • @princeanujk
    @princeanujk 3 года назад +1

    Amazing Content...💕
    Just Watch @ 0.75x Playback Speed...

  • @zoksss5323
    @zoksss5323 2 года назад

    I have a question. So basically, when user joins, you push its username and id to usernames array, which contains all users. But what happen if user leaves and his info still stays in array? I'm doing something simmilar with pushing room code which is a object with few details and users insde that room eg.
    "123" = {leaderId: "", isLocked: false, sockets: []}
    , but when all users leave, i want to destroy that room object, but idk how to do it properly, or is it even possible, or shoud I change whole system for better one, since Im still new to socketio?

  • @DoctorMandible
    @DoctorMandible Год назад

    What's the advantage of using express when you're also using socket?

  • @ivaylosilovski5529
    @ivaylosilovski5529 3 года назад +3

    Great content! Keep it on going :)

  • @_MoshikoAz_
    @_MoshikoAz_ Год назад

    thank you Chaim, can you please provide git source ?

  • @rezaulmasum205
    @rezaulmasum205 4 года назад

    hey If I would like to access socket in another page like I have multiple controller, how can we pass it to different pages?

  • @nom21304
    @nom21304 3 года назад +3

    imagine him rapping :o

  • @nickvelos9571
    @nickvelos9571 3 года назад

    Bruf he has surpassed Eminems level of speed speaking

  • @realzoogies
    @realzoogies 2 года назад

    awesome video 👍

  • @theunknownclone8084
    @theunknownclone8084 3 года назад

    Great video!!!

  • @maheshmahadar4780
    @maheshmahadar4780 3 года назад

    in my website i cant use @t on multiple pages.
    is it valid or not i am doing ?

  • @ouss
    @ouss 4 года назад

    Can you do one with the twilio video rooms API, its easier

    • @CodingWithChaim
      @CodingWithChaim  4 года назад

      Can certainly take a peek into it

    • @ouss
      @ouss 4 года назад

      @@CodingWithChaim It would be great and quick in just 10min

  • @hanibal43
    @hanibal43 4 года назад

    always love your vids! would love to see you make more vids on javascript and react

    • @CodingWithChaim
      @CodingWithChaim  4 года назад

      Thank you! Do you have a specific topic in mind you’d like me to cover?

    • @hanibal43
      @hanibal43 4 года назад

      @@CodingWithChaim personally I would love to see a full react application using all the react features but as practical components something you would see in real life.

    • @hanibal43
      @hanibal43 4 года назад

      Would even be great as a separate course explaining the behind the good of the js side

  • @capenburbank9307
    @capenburbank9307 3 года назад

    new to programming here, but learning fast. This has been the best information so far and exactly what I've looked for! You explain everything in depth and it's really quite helpful, I'll be tuning in much more frequently from now on!

  • @henryho952
    @henryho952 3 года назад

    Great Content! Thanks! Subscribed! :)

  • @josephmenasandoval3419
    @josephmenasandoval3419 3 года назад

    why you dont use rooms of socket io ? socket io has a buided function

  • @andresbr92
    @andresbr92 4 года назад

    Very nice video. Thank you a lot

  • @oyerindejoshua9365
    @oyerindejoshua9365 2 года назад

    pls where is the part two

  • @Lordaniel-K
    @Lordaniel-K 2 года назад

    מדהים

  • @ashishafk
    @ashishafk 3 года назад

    can you please slow down a little its quite fast for me tbh. otherwise video is very helpful.

  • @kumar_sanjeevdutta1069
    @kumar_sanjeevdutta1069 9 месяцев назад

    Really great, but you speak too fast, I am native Hindi speaker and thank God RUclips has this slow video speed feature 🙏🙏

  • @rezaulmasum205
    @rezaulmasum205 4 года назад

    Will you make any video on private chat ?

    • @CodingWithChaim
      @CodingWithChaim  4 года назад

      Would you mind elaborating a little more about what you mean?

    • @rezaulmasum205
      @rezaulmasum205 4 года назад

      @@CodingWithChaim Like there is a list of user in a chat room, but I would like to chat with an specific user. Private chat

    • @CodingWithChaim
      @CodingWithChaim  4 года назад

      This video covers that too

  • @ayikkathilkarthik4312
    @ayikkathilkarthik4312 3 года назад

    That was an awesome explanation.

  • @martinn1071
    @martinn1071 3 года назад +1

    Great stuff. Thanks!
    You might wanna add a beat in the background...it would also make a great rap improv....
    Just saying....
    Thanks again ! Cheers

  • @ikibkilam8383
    @ikibkilam8383 3 года назад

    Simply awesome! Quite easily, the best channel on youtube.

  • @x4r7
    @x4r7 2 года назад

    this is the first video where i need to slow down to 0.75

  • @milada424
    @milada424 3 года назад

    9:16 dude's a rap god

  • @evoqqqq
    @evoqqqq 3 года назад

    Great tutorial! Could you please update the github repo because the code from part 1 & 2 is not included. Best regards, evoq!

  • @muhammadhamzahaneefqureshi5016
    @muhammadhamzahaneefqureshi5016 4 года назад

    Millions subscribers on the way. Great stuff as usual. 😊

  • @MrPoppshot
    @MrPoppshot 3 месяца назад

    I thought my video was on 2x speed.

  • @softultraviolence5673
    @softultraviolence5673 2 года назад

    great video! But man, you sound like a texan auctioneer

  • @jcfiedalan8172
    @jcfiedalan8172 3 года назад

    You can beat Eminem :)

  • @zxcyuu6141
    @zxcyuu6141 3 года назад

    Sir, your server.js on github is empty, i wanna know how callback function works.

  • @blameItleaveit
    @blameItleaveit Год назад

    bro is rapping

  • @ikoLinh
    @ikoLinh Год назад

    hablas rapidísimo, pensé que sabia ingles😅

  • @lucifer4386
    @lucifer4386 3 года назад

    im trying to make a clone (on a small scale) of discord and believe me this really helped

  • @HeyNelsonn
    @HeyNelsonn 3 года назад

    Could you teach us how to deploy these apps on Heroku?

  • @geraldomaga
    @geraldomaga 3 года назад

    Are u sure that you belong to this planet earth?

  • @jackmiddleton2080
    @jackmiddleton2080 2 года назад

    1337... My man.

    • @CodingWithChaim
      @CodingWithChaim  2 года назад

      You’re the first person to comment on this easter egg

  • @Je3f0o
    @Je3f0o 2 года назад

    Eminem?

  • @mod7ex_fx
    @mod7ex_fx 2 года назад

    shalom

  • @shreyanmehta6999
    @shreyanmehta6999 2 года назад

    didnt needed to make its speed faster