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

Ғылым және технология

This framework, changes that.
Rust is quickly becoming one of my favorite languages for writing services.
Become a better developer in 4 minutes: bit.ly/45C7a29 👈
Video Links:
Chatly Web: github.com/dreamsofcode-io/ch...
Socketioxide: github.com/Totodore/socketioxide
Finished Code: github.com/dreamsofcode-io/ch...
Axum Issue (now resolved): github.com/Totodore/socketiox...
Join this channel to get access to perks:
/ @dreamsofcode
Come say hi on Discord: / discord
Follow me on Twitter: / dreamsofcode_io

Пікірлер: 134

  • @nostrorom
    @nostrorom4 ай бұрын

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

  • @TheRealKeyvan
    @TheRealKeyvan6 ай бұрын

    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

    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!

  • @BaronXOfficial
    @BaronXOfficial6 ай бұрын

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

  • @dreamsofcode

    @dreamsofcode

    6 ай бұрын

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

  • 6 ай бұрын

    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

  • @nbbhaskar3294
    @nbbhaskar32946 ай бұрын

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

  • @kiyov09
    @kiyov096 ай бұрын

    Nice! I’ll be playing with this soon 🔥

  • @indramal
    @indramal5 ай бұрын

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

  • @nathanoy_
    @nathanoy_6 ай бұрын

    Awesome video, as always.

  • @ravingswe
    @ravingswe4 ай бұрын

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

  • @0lange
    @0lange6 ай бұрын

    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

  • @SOMEWORKS456
    @SOMEWORKS4565 ай бұрын

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

  • @jorgevillalta8487
    @jorgevillalta84876 ай бұрын

    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.

  • @guray00
    @guray005 ай бұрын

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

  • @GeekMasher
    @GeekMasher6 ай бұрын

    Amazing project and amazing video!!

  • @dreamsofcode

    @dreamsofcode

    6 ай бұрын

    Thank you!

  • @dekrain
    @dekrain5 ай бұрын

    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

    5 ай бұрын

    You are 100% correct.

  • @IllllIIllllI

    @IllllIIllllI

    4 ай бұрын

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

  • @noisetide
    @noisetide6 ай бұрын

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

  • @cryptic_daemon_

    @cryptic_daemon_

    6 ай бұрын

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

  • @noisetide

    @noisetide

    6 ай бұрын

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

  • @schroedingerundkatze

    @schroedingerundkatze

    6 ай бұрын

    @@noisetide If you are used to a hammer everything starts looking like a nail.

  • @noisetide

    @noisetide

    6 ай бұрын

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

  • @joseburgosguntin
    @joseburgosguntin6 ай бұрын

    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

    6 ай бұрын

    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.

  • @ru31k32
    @ru31k326 ай бұрын

    This man is awesome. :)

  • @theangelofspace155
    @theangelofspace1556 ай бұрын

    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

  • @kalempster
    @kalempster6 ай бұрын

    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

    6 ай бұрын

    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 :)

  • @IvanRandomDude
    @IvanRandomDude6 ай бұрын

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

  • @StingSting844

    @StingSting844

    6 ай бұрын

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

  • @PejmanRezaei-qv9lt
    @PejmanRezaei-qv9lt5 ай бұрын

    thanks for sharing such a cool video

  • @letscode9542
    @letscode95426 ай бұрын

    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

    6 ай бұрын

    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

    5 ай бұрын

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

  • @01speed1
    @01speed16 ай бұрын

    What is your vim and terminal configuration ?

  • @sujjee
    @sujjee5 ай бұрын

    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.

  • @Zitrussaft
    @Zitrussaft6 ай бұрын

    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

    6 ай бұрын

    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

    6 ай бұрын

    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

    6 ай бұрын

    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

    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

    6 ай бұрын

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

  • @kenzo3477
    @kenzo34776 ай бұрын

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

  • @sshivam6955
    @sshivam69556 ай бұрын

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

  • @rando521
    @rando5216 ай бұрын

    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.

  • @cdbattags
    @cdbattags5 ай бұрын

    What's the addon for the Cargo warnings?

  • @yassineelmellouki9655
    @yassineelmellouki96554 ай бұрын

    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

    4 ай бұрын

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

  • @yassineelmellouki9655

    @yassineelmellouki9655

    3 ай бұрын

    @@dreamsofcode this worked thanks for the comment!

  • @panthonyy
    @panthonyy4 ай бұрын

    Jsut given me more motivation to learn Rust haha

  • @dadinhoschannel4003
    @dadinhoschannel40036 ай бұрын

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

  • @dreamsofcode

    @dreamsofcode

    5 ай бұрын

    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.

  • @arnimlost
    @arnimlost5 ай бұрын

    Where do you get your desktop wallpapers from?

  • @dreamsofcode

    @dreamsofcode

    5 ай бұрын

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

  • @Zamiell
    @Zamiell6 ай бұрын

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

  • @dreamsofcode

    @dreamsofcode

    6 ай бұрын

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

  • @veritatas678
    @veritatas6785 ай бұрын

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

  • @everythingbuttherain6323
    @everythingbuttherain63236 ай бұрын

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

  • @iyxan2340
    @iyxan23406 ай бұрын

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

  • @Sculman7

    @Sculman7

    6 ай бұрын

    I believe the feature is called "inlay type hints"

  • @RodolfoDeNadai
    @RodolfoDeNadai6 ай бұрын

    Cool!

  • @ChanceDinkins
    @ChanceDinkins6 ай бұрын

    What plugin are you using to show versions of crates?

  • @dreamsofcode

    @dreamsofcode

    6 ай бұрын

    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

    6 ай бұрын

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

  • @ViciOuSKiddo
    @ViciOuSKiddo4 ай бұрын

    I kept waiting for you to say "WebRTC"

  • @otsov
    @otsov4 ай бұрын

    I need your nvim setup please

  • @rithvik_
    @rithvik_6 ай бұрын

    What editor do u use?

  • @dreamsofcode

    @dreamsofcode

    5 ай бұрын

    I use Neovim!

  • @RenderingUser
    @RenderingUser6 ай бұрын

    Socketioxide ofcourse whyd i expect any other name

  • @v01d_r34l1ty

    @v01d_r34l1ty

    6 ай бұрын

    fax

  • @dreamsofcode

    @dreamsofcode

    6 ай бұрын

    It was so difficult to say 😭

  • @RenderingUser

    @RenderingUser

    6 ай бұрын

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

  • @RenaudDenis
    @RenaudDenis4 ай бұрын

    😍

  • @landonwork675
    @landonwork6756 ай бұрын

    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.

  • @lukehjo
    @lukehjo6 ай бұрын

    Interesting.

  • @budgeter4807
    @budgeter48074 ай бұрын

    What IDE is this?

  • @zeroows
    @zeroows5 ай бұрын

    Ur mixing JS with Java in the chat room :)

  • @JoeldaSilvaVicenteFilho
    @JoeldaSilvaVicenteFilho5 ай бұрын

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

  • @Alberto_Cavalcante
    @Alberto_Cavalcante5 ай бұрын

    +1 Subscriber

  • @otsov
    @otsov4 ай бұрын

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

  • @gosnooky
    @gosnooky4 ай бұрын

    CORS - the natural predator of the web developer 🤣

  • @fortunatmutunda4194
    @fortunatmutunda41946 ай бұрын

    I thought tide was your favourite

  • @dreamsofcode

    @dreamsofcode

    6 ай бұрын

    Y'all convinced me otherwise!

  • @lukasbelck4514
    @lukasbelck45146 ай бұрын

    thx youtube for this recommenndation

  • @Viralvlogvideos
    @Viralvlogvideos6 ай бұрын

    what is this symbol :: ?

  • @theodoreprevot4964

    @theodoreprevot4964

    5 ай бұрын

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

  • @ibraheemhaseeb3660
    @ibraheemhaseeb36605 ай бұрын

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

  • @Antonio-yy2ec
    @Antonio-yy2ec5 ай бұрын

    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 KZread 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 KZread. If I think correctly they have some kind of channel cloning feature to automatically copy anything you upload first to KZread

  • @dreamsofcode

    @dreamsofcode

    5 ай бұрын

    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

    5 ай бұрын

    @@dreamsofcode Sure!

  • @timschannel247
    @timschannel2474 ай бұрын

    are you from the 90s har har har

  • @dreamsofcode

    @dreamsofcode

    4 ай бұрын

    1890s

  • @raduking
    @raduking6 ай бұрын

    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

    5 ай бұрын

    ​@@ino98 Discord is buggy af

  • @Redyf
    @Redyf6 ай бұрын

    First! 🐧

  • @RoamingAdhocrat
    @RoamingAdhocrat5 ай бұрын

    pls can you pronounce it "sockettyoxide" tho

  • @0runny
    @0runny5 ай бұрын

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

  • @Nemesis-db8fl

    @Nemesis-db8fl

    5 ай бұрын

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

  • @TheOne11111
    @TheOne111116 ай бұрын

    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

    6 ай бұрын

    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

    6 ай бұрын

    ​@@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

    6 ай бұрын

    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

    6 ай бұрын

    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

    6 ай бұрын

    @@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.

Келесі