Building an HTTP Server in Rust: Exploring TCP/IP, Socket Programming, and Asynchronous I/O

Поділитися
Вставка
  • Опубліковано 26 тра 2023
  • In this video, we dive into the world of Rust programming and embark on a thrilling adventure of building an HTTP Server from scratch. Join us as we explore the intricacies of TCP/IP, Socket Programming, and Asynchronous I/O.

КОМЕНТАРІ • 39

  • @kshitijmohan3992
    @kshitijmohan3992 11 місяців тому +29

    The “i have no idea how this works” really flames my imposter syndrome, and no matter how good I am as a programmer, it always makes me feel less than. The only way to counter this feeling is to go ahead a learn how this works. I think this video is a manifestation of that feeling and i am really glad you uploaded this!

    • @saltyowl3229
      @saltyowl3229 5 місяців тому +1

      There’s a better way to counter that IF you are conscious of it and aware of possible issues. Chances are you were curious about whatever it is at one point, and someone who didn’t feel like taking the time to properly explain the concept at a deeper level gave you a very surface level, someone else’s library documentation sorta understanding. Most of the time that person isn’t yourself, and people giving these half descriptions of things do genuinely cause issues by doing so. Be mad about that, be upset that we don’t live in a society more accommodating to natural human curiosity.
      But if you can get imposter syndrome over something, chances are it’s because you are curious; you feel like you SHOULD know it. If that’s the case you aren’t an imposter, but have merely been forced through a situation wherein you could not learn about it. Be mad at that situation, not at yourself. Be SPITEFUL that anyone EVER believed it was better for you not to learn something. It’ll fuel you to learn it well should you be doing so out of spite.
      Great trick, works well for me, just gotta be conscious if it was really any particular person’s fault, or unfortunate circumstance they were forced into alongside you. Don’t hate the player, hate the game, sorta mindset. Getting personally angry at others for something so unintentional just isn’t productive, or good

  • @gautamprikshit1
    @gautamprikshit1 Рік тому +16

    Dayum you really started the channel with a bang, lot of effort into production and content.

    • @codemoons
      @codemoons  Рік тому +6

      Thanks for watching! Next video is going to be about neural networks and machine learning in rust from complete scratch.

  • @abisarwan20
    @abisarwan20 11 місяців тому +9

    i don't find the link for the code in description xD

  • @oghenemarho5694
    @oghenemarho5694 Рік тому +3

    Amazing content! I have always wondered how servers worked under the hood in Rust. This also shows the amount of work it takes to make a robust server framework which needs to be appreciated more especially as most are open-source.

    • @codemoons
      @codemoons  Рік тому +2

      Yea Definitely the open source community needs more appreciation. After I made this project I was thinking about how many different exploits and security vulnerabilities would work on this server. Open source community does all that work for free.

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

      @@codemoons Thank you for your perspective! Hopefully one day you'll make a video about writing a library crate for an API in Rust.

  • @theshlok
    @theshlok 9 місяців тому +1

    Good for new rustaceans! Subscribed👋

  • @3boody738
    @3boody738 Рік тому

    Keep going bro, I think you will have a bright future

  • @symbioticparasite6268
    @symbioticparasite6268 11 місяців тому

    Subbed , your amazing!

  • @user-yc5ms1yf5b
    @user-yc5ms1yf5b 3 місяці тому

    Great video

  • @chida-san
    @chida-san 10 місяців тому

    Good content, this one in particular could have a repository showing this example of yours.

  • @underflowexception
    @underflowexception 3 місяці тому +1

    Around 2:59 you mentioned that when there's no more data to process you close the connection but what if you want to return a response back to the client don't you have to keep it open?

  • @barratech
    @barratech 11 місяців тому +1

    Really nice upload video !
    Just a suggestion
    Please add the source code reference in the description of your video, it may be helpfull

  • @alpaslaneldemir6904
    @alpaslaneldemir6904 11 місяців тому

    Good thing you blurred out PHub. Good content keep it up.

  • @thekwoka4707
    @thekwoka4707 11 місяців тому +2

    Wow, solid video.
    Good overview and demonstration.
    I think it can be helpful to clarify on your coding examples which stuff is "this is what we are doing to demo stuff" vs "this is really what is actually part of hiw the thing is implemented"

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

    I've been waiting for something like this!
    Could you make a video about parsing the buffer into a custom data structure? I looked at your source doe, but you used the `httparse` crate, which seems to do the heavy lifting.

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

      @@codemoons I once tried to write a little TCP multiplayer server with Tokio and struggled with parsing the buffer into a custom message. It got confusing and I gave up and wrote it in Elixir, but it always bothered me that I couldn't do it. So, I'd love a tutorial on that. 😁

  • @jubiaj2672
    @jubiaj2672 Рік тому +2

    Nice video. I would appreciate it if you could go more a bit into depth about the OSI model and how that connect to Rust

  • @williammcroberts5127
    @williammcroberts5127 11 місяців тому +4

    Source Code ?

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

    Subscribing for the future. Content looks good and I Reay want to learn RUST so.....

  • @BERNOUSSAMA
    @BERNOUSSAMA 8 місяців тому +1

    great video, thanks for sharing! but filming yourself writing it would've been heaps better imo. also can you share the code with us ? I would love to take a look at it, and learn from it

    • @codemoons
      @codemoons  8 місяців тому

      github.com/codemoonsxyz/neural-net-rs , Here you go! Thanks for the feedback! I need to find a way to film it without it being boring.

  • @Exodus9874
    @Exodus9874 11 місяців тому

    Is there the source code in the description

  • @edwardmacnab354
    @edwardmacnab354 4 місяці тому

    i don't know how perl works either but have no desire to spend my life reading the source code

  • @codemoons
    @codemoons  8 місяців тому

    github.com/codemoonsxyz/neural-net-rs

    • @dominikskubla3099
      @dominikskubla3099 4 місяці тому +1

      I mean first of all thank you for video but I think this source code is related to your second video not this one. Or am I wrong?

    • @baconmanthelegend
      @baconmanthelegend 4 місяці тому

      wrong link bruh

  • @TonKcedua
    @TonKcedua 11 місяців тому +2

    "Every builder must know their tools."
    Every builder must know _how_ _to_ _use_ their tools _effectively_ - they don't have to know the exact chemical composition of those tools. I don't mean to say that this kind of learning isn't worthwhile, but especially in _very_ large codebases, sometimes this kind of learning - especially during a dayjob - just isn't realistic.

    • @codemoons
      @codemoons  11 місяців тому

      Yea you're right. However the foundations I think we should know. For example if you are in cyber sec you should know the ins and outs of networking very well.

    • @thekwoka4707
      @thekwoka4707 11 місяців тому

      It's ideal if they want to actually become masters.

  • @FixIt42
    @FixIt42 11 місяців тому +2

    I thought this project was short enough to at least show and quick explain all the code. This did not give me anything. Disappointed! Why talk quick about a few bits when there is so much more. I did actually start typing. I found this on github when googling so now I know how much more there is!! :( More input in my comment below

    • @codemoons
      @codemoons  11 місяців тому +2

      Great Advice. I'm still new with creating programming content so I wasn't sure how in depth to go with it. I will definitely keep this in mind for next time. great critique.

  • @Ryan_404
    @Ryan_404 5 місяців тому +2

    Maybe go for less style and more substance next time. I have experience using Rust for network programming but the way you copy-paste large blocks of code and then rapidly move on made your explanations in the coding sections nearly incomprehensible at times even for me.

    • @codemoons
      @codemoons  5 місяців тому

      Good advice! Wanted to strike a balance between entertainment and education heavy.

  • @strelkan
    @strelkan 11 місяців тому +2

    not deep enough

    • @codemoons
      @codemoons  11 місяців тому

      Yea, still experimenting with how technical the videos should be.

    • @FixIt42
      @FixIt42 11 місяців тому +1

      @@codemoons Everything but complete is useless for this kind of thing. You have to decide if you want to explain http servers or show of a rust project (without a code deep dive) or make a programming tutorial. This is none of these and too tiny parts of all to be useful. I should have seen where it was hearing with the long explaination of osi being cut in half. I would have liked a full programming tut.