I never thought I'd use Socket.io ever again

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

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

  • @nostrorom
    @nostrorom 7 месяцев назад +43

    5:17 "This is due to CORS. The natural predator of a web developer."
    Truer words have never been spoken

  • @TheRealKeyvan
    @TheRealKeyvan 9 месяцев назад +32

    Really don't know how you do it. I had recently been thinking about using Tauri to create a chat app for fun with Rust, and then you just release this. Now I'm even more inspired.

    • @dreamsofcode
      @dreamsofcode  9 месяцев назад +6

      Tauri is so awesome. I've got a video in my backlog to do on it!
      Let me know how your chat app turns out!

  • @SOMEWORKS456
    @SOMEWORKS456 8 месяцев назад +2

    You've done a tremendous job at explaining why socket shines in rust.

  • @dekrain
    @dekrain 9 месяцев назад +11

    Great video! I just want to say to be careful with CORS. Blindly accepting requests from different origins may cause some security problems to occur. Just mentioning that it should be dealt with properly is enough, but IMO it should at least be acknowledged.

    • @dreamsofcode
      @dreamsofcode  9 месяцев назад +2

      You are 100% correct.

    • @IllllIIllllI
      @IllllIIllllI 8 месяцев назад

      you can use Vite's server config to proxy all requests to the Rust server, skipping CORS entirely.

  • @noisetide
    @noisetide 9 месяцев назад +51

    This was so easy to understand. Rust is amazing. I hope it will be used more in web development world.

    • @cryptic_daemon_
      @cryptic_daemon_ 9 месяцев назад +2

      I hope to use it in the Embedded Systems World!!

    • @noisetide
      @noisetide 9 месяцев назад +1

      @@cryptic_daemon_ Rust can be used anywhere. Hense a joke to rewrite everything in rust xD

    • @noisetide
      @noisetide 9 месяцев назад +2

      @@schroedingerundkatze Yes, but when you held a hummer and a screwdriver then everything is a screwnail

  • @Zitrussaft
    @Zitrussaft 9 месяцев назад +89

    I have this feeling whenever working with rust: it seems to do simpler tasks really well, but as soon as you want something a little bit more advanced than what's on the README it becomes a mix of experimental features and hard to read code (like when adding state in this video). Still, pretty good language, excited to see where it will go

    • @orterves
      @orterves 9 месяцев назад +20

      I think that's the nature of an ecosystem that's still in its infancy - it's much the same situation in many languages and frameworks.
      The risk is usually that adopting these systems before they are proven can result in being stuck in an abandoned and incomplete system - at least with Rust it seems unlikely that adoption will slow down at all

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

      I really wanted to like Rust but it looks ugly and always complex. Like, I spent like a year in C/C++ and I can get deep into complex codes, but I prefer not to nowadays. Life is too short for that.
      I love TS but for realtime servers and/or heavy performance usage it isn't an option. I use Kotlin in my current job and it's fine. Zig seems interesting, due to Bun. C# is an option but I didn't fall in love with it tbh.

    • @theintjengineer
      @theintjengineer 9 месяцев назад +14

      Precisely. We did try using it here, but as soon as we dealt with large-scale, Enterprise-level projects, etc., Rust just couldn't _handle_ that somehow. We come to a point where C++ is way more appropriate, besides, from a particular point of complexity onwards, Rust becomes almost as complicated as C++, but with less maturity, and not nearly as many _experts_ in it as we have in C++. So, that's where we are - C++ still is our primary language and even the choice for our new projects.
      However, we do use Rust for some other smaller tasks, or some Networking, Parsing, De-/Serialisation, some Database stuff, and so on.

    • @vintagewander
      @vintagewander 9 месяцев назад +6

      I agree, rust is more like if you already know what you're about to do, in each step by step how a feature is going to be implemented, then rust is really great. But for rapid prototyping, or tesing out new features implementation, then things start to get very complicated

    • @theintjengineer
      @theintjengineer 9 месяцев назад +12

      Hm, because every application is like Discord, right!!?
      Alright then. Our bad.

  • @BaronXOfficial
    @BaronXOfficial 9 месяцев назад +6

    Great video! Excellent work, subscribed and looking forward to more Rust related content!

    • @dreamsofcode
      @dreamsofcode  9 месяцев назад +1

      Awesome, thank you! I'm looking forward to creating more :)

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

    This is why I subscribed to your channel. If you can, I suggest doing gRPC tutorial for client and sever sides.

  • @HosseinOjvar
    @HosseinOjvar 14 дней назад

    Thanks so much for the awesome tutorial!

  • @sujjee
    @sujjee 8 месяцев назад +2

    Hey man, this is the first time I've really liked Rust! The way you've written this Rust code feels similar to how I write TypeScript. I kindly request you to start a series of Rust tutorials. I'm eager to explore low-level and system languages.

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

    your golang chi video on net ninja was so healpful!
    Just a suggestions, but please make a small demo video showing off how you would use golang (chi router), htmx or html, and postgres together while containerizing the application with docker for deployment. I'm especially having a hard time understanding deployment step

  • @jorgevillalta8487
    @jorgevillalta8487 9 месяцев назад +5

    I was was trying to achieve exactly the same but using tokio-tungstenite, which soon got out of control. But this feels just as writing more axum. I'll definitively re write it in socketioxide.

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

    Thanks for this awesome video, subscribed and looking forward to more content in this space.

  • @ravingswe
    @ravingswe 8 месяцев назад

    great video. the way you progress the project is easy enough to consume

  • @joseburgosguntin
    @joseburgosguntin 9 месяцев назад +4

    I'm a big fan of axum, and have been trying to set a basic web app with a postgres db, oauth and htmx. But the compile times haven't been very nice, especially when modifying askama template's, how do u deal with this without using React but still preserving type safe templates.

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

      Compile times in Rust are brutal.
      It's tough without splitting up the front and backend, your best bet will probably be something like cargo-watch for hot reloading however.

  • @GeekMasher
    @GeekMasher 9 месяцев назад +1

    Amazing project and amazing video!!

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

    Nice! I’ll be playing with this soon 🔥

  •  9 месяцев назад +2

    Built simple socket io backend recently and had to go the nodejs way as Go was too old. This is a great solution. Thanks for sharing

  • @nathanoy_
    @nathanoy_ 9 месяцев назад +2

    Awesome video, as always.

  • @rando521
    @rando521 9 месяцев назад +8

    damn i might actually do this,
    a socketio tutorial in python was the first ever web project or real project i did
    so this is a nice throwback.
    this might be me being used to programming but it took me 15minutes to understand the implementation in rust compared to 3hours in python.

  • @IvanRandomDude
    @IvanRandomDude 9 месяцев назад +4

    Is it worth it to still use socketio or equivalent libraries instead of using something like Pusher at this point?

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

      That entirely depends on the time and cost you have for development

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

    Really good video!!
    Is there a way to authenticate when connect to socket? Looks like the latest versions cannot get handshakes headers to get a Bearer token...

  • @kalempster
    @kalempster 9 месяцев назад +2

    Very nice, but is the room property really needed on the message object? If we're controlling in which room the user is on the server we know to which room the message should go, instead we trust the client that he provided the same room name as he is currently in? What if the client emits a join on room A event and emits a message event on room B?

    • @dreamsofcode
      @dreamsofcode  9 месяцев назад +1

      You're 100% Correct. This would be another good example of using state to keep track of which room a socket is a part of. The framework also supports storing state per socket, which would be a good use case for this.
      Never trust the client :)

  • @guray00
    @guray00 8 месяцев назад

    Awesome video! How do you do this kind of animation? Do you use presentation tools or directly on the video editor?

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

    A video on how to setup the terminal and editor like yours in mac would be appreciated. I watched the on you made on tmux, we need the all in ome video for both nvim and tmux, as well as your choice of terminal emulator

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

    I don't know what I watched but that terminal kept me focused.

  • @ru31k32
    @ru31k32 9 месяцев назад +2

    This man is awesome. :)

  • @RenderingUser
    @RenderingUser 9 месяцев назад +3

    Socketioxide
    ofcourse whyd i expect any other name

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

      fax

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

      It was so difficult to say 😭

    • @RenderingUser
      @RenderingUser 9 месяцев назад +1

      @@dreamsofcode try thinking of carbondioxide when you say that word

  • @ViciOuSKiddo
    @ViciOuSKiddo 8 месяцев назад

    I kept waiting for you to say "WebRTC"

  • @PejmanRezaei-qv9lt
    @PejmanRezaei-qv9lt 9 месяцев назад

    thanks for sharing such a cool video

  • @otsov
    @otsov 7 месяцев назад

    Why use node instead of rust, especially if already writing some parts in rust!

  • @everythingbuttherain6323
    @everythingbuttherain6323 9 месяцев назад +1

    damn, am i the only one who uses native websocket feature of axum

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

    I am not a rust guy, but this made me reconsider

  • @yassineelmellouki9655
    @yassineelmellouki9655 7 месяцев назад

    Hey Dreams of Code, this was amazing and works great. Was wondering if its possible to create collections in MongoDB with this combo of rust and socketioxide?

    • @dreamsofcode
      @dreamsofcode  7 месяцев назад +1

      Yes you can! You should be able to use the MongoDB driver for Rust!

    • @yassineelmellouki9655
      @yassineelmellouki9655 6 месяцев назад

      @@dreamsofcode this worked thanks for the comment!

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

    What's your neovim setup?

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

    Please do a video on websockets on sending files to ws server.

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

    What is your vim and terminal configuration ?

  • @panthonyy
    @panthonyy 7 месяцев назад

    Jsut given me more motivation to learn Rust haha

  • @otsov
    @otsov 7 месяцев назад

    I need your nvim setup please

  • @zeroows
    @zeroows 9 месяцев назад +1

    Ur mixing JS with Java in the chat room :)

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

    Thanks for thoe Video. A little question: which "plugin" do you use vor nvchad to display the available/current Version in your'e cargo.toml file. Works this only for rust or also for golang mod files and js package.json files?

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

      It is the Saecki/crates.nvim plugin!
      I have a video on setting up Rust for Neovim which uses it as well if you need a reference :)

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

      @@dreamsofcode Thank you for the response. So its only for creates dependencies. I search for a similar plugin for go and node.

  • @cdbattags
    @cdbattags 8 месяцев назад

    What's the addon for the Cargo warnings?

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

    Are there any updates to setup rust with Neovim from the past 8 months? Or that video is still up to date?

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

      Rust tools is likely a little out of date now, I'd recommend sticking with the language server only!
      I'll probably do a follow up video in a few years time.

  • @gosnooky
    @gosnooky 7 месяцев назад

    CORS - the natural predator of the web developer 🤣

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

    9:51 How could you make the language server show the types?

    • @Sculman7
      @Sculman7 9 месяцев назад +2

      I believe the feature is called "inlay type hints"

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

    can you put the link to the github issue in the description?

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

      Great idea. Doing it now! Looks like the issue also got resolved just before I released the video

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

    this video just made me have the urge to rewrite my node webserver in rust, it not even use Socket or websockets hahaha

  • @arnimlost
    @arnimlost 8 месяцев назад

    Where do you get your desktop wallpapers from?

    • @dreamsofcode
      @dreamsofcode  8 месяцев назад

      I get them off of Freepik! Some of them are free but others are licensed

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

    I'd definitely use this... As soon as I fugre out how the heck to use state in Axum. I don't like not knowing what's going on behind the scenes.

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

    What plugin are you using to show versions of crates?

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

      I'm using the wonderful Saecki/crates.nvim plugin. I have a video on setting up Rust with Neovim which showcases it as well!

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

      Awesome, thanks@@dreamsofcode.
      Your videos are great, btw. Definitely going to check out that video.

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

    I thought tide was your favourite

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

      Y'all convinced me otherwise!

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

    What editor do u use?

  • @budgeter4807
    @budgeter4807 8 месяцев назад

    What IDE is this?

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

    rust looks scary but i am going to develop a web server with rust after my finals.

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

    Cool!

  • @Antonio-yy2ec
    @Antonio-yy2ec 9 месяцев назад +1

    Dream of code can I ask you a huge favor, could you please also upload your content to Odysee too? I really enjoy your masterclasses and I’m always fascinated with every video you upload but I’m trying to avoid using RUclips spyware as most as possible. I know I’m only the 0.01% but uploading to this platform should not break your current one with RUclips. If I think correctly they have some kind of channel cloning feature to automatically copy anything you upload first to RUclips

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

      Hey! Thanks for asking. I'll check it out.
      Do you happen to have discord? I'd love to chat with you a little more and find out more about Odysee from your perspective.

    • @Antonio-yy2ec
      @Antonio-yy2ec 9 месяцев назад

      @@dreamsofcode Sure!

  • @lukasbelck4514
    @lukasbelck4514 9 месяцев назад +1

    thx youtube for this recommenndation

  • @RenaudDenis
    @RenaudDenis 8 месяцев назад

    😍

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

    what is this symbol :: ?

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

      It basically propagate a potential error to the end of the scope rather than handling it directly.

  • @Alberto_Cavalcante
    @Alberto_Cavalcante 8 месяцев назад

    +1 Subscriber

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

    Interesting.

  • @timschannel247
    @timschannel247 7 месяцев назад

    are you from the 90s har har har

  • @raduking
    @raduking 9 месяцев назад +1

    This could also be a tutorial on how to write unmaintainable software.
    Also Rust has the same old problem like C++, it doesn’t have JIT and it is plagued by poorly written async libraries, so it is not viable for enterprise server applications.

    • @gileee
      @gileee 8 месяцев назад

      ​@@ino98 Discord is buggy af

  • @RoamingAdhocrat
    @RoamingAdhocrat 8 месяцев назад

    pls can you pronounce it "sockettyoxide" tho

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

    As soon as node or rpm is mentioned I switch off. Rust rules.

    • @Nemesis-db8fl
      @Nemesis-db8fl 8 месяцев назад +1

      What about when u have to deploy apps in production with very less time

  • @TheOne11111
    @TheOne11111 9 месяцев назад +2

    I never thought Rust code will be that ugly. Anyway, I need to learn it first to see how ugly it can be. So far, I'm not impress at all. I also want to know what the famous Rust borrow checker do.

    • @christopher8641
      @christopher8641 9 месяцев назад +1

      Your ability to solve a problem should not be restricted by how ugly the code is that resolved it. Readability comes with experience with the language.

    • @robonator2945
      @robonator2945 9 месяцев назад +2

      ​@@christopher8641 look, I get what you're saying, but that is some *_ugly_* code. Rust can be nice in places, but good looks ain't one of 'em.

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

      The video is using fully qualified names for the functions and structs he pulls in. It’s nice for a tutorial, but not very beautiful. It would be a little cleaner in the wild.

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

      Rust can be very easy to make look gross.
      I would normally structure projects better than this in my normal day to day. I try not to refactor in videos, but it certainly makes the code look more messy.

    • @bear458ziif-s
      @bear458ziif-s 9 месяцев назад

      @@dreamsofcode i didn't think it was that messy. rust just looks this way to people that are unfamiliar with it. i thought it was readable enough.

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

    First! 🐧