Creating a Web Server from Scratch in C

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

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

  • @mermaidcodes
    @mermaidcodes Год назад +63

    I'm very poor and I have an old PC but I love programming . I thought maybe if I use c I can become a really good developer ^_^ thank you 😊 this is life changing for me

    • @GabrielxC
      @GabrielxC 11 месяцев назад +3

      Hey good luck, where are you from?

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

      @rocher-j3b 😎

    • @yonatannisenboym2548
      @yonatannisenboym2548 2 месяца назад

      good luck! programing is really amazing! how is it going for you?

    • @rakeshwasnik8243
      @rakeshwasnik8243 6 дней назад

      I hope you have an ssd if u dont, buy one for cheap and replace and then install some lightweight linux distro itll run way smooth

    • @dlc5566
      @dlc5566 День назад

      Hope your financial situation got better

  • @nsrc9583
    @nsrc9583 Год назад +5

    This showed up on my feed and it was great watching this over dinner. I haven't touched C since undergrad (been with Haskell for I don't know how long now) and it's refreshing to watch some good, honest C code. I hope you continue making videos this coming year, you're great at presenting and it's clear you're experienced. Will share your channel for a boost.

  • @rauldeandrade
    @rauldeandrade 3 года назад +22

    How do you not have a million subscribers is beyond me! This is really great subject. Practical C tutorials are like diamonds. Super valuable and in short supply. Keep going. You're awesome

    • @eom-dev
      @eom-dev  3 года назад +2

      Thanks Raul! I really appreciate you saying that :)

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

      That is why professor salary is less than singer or comedian :D but the true, if we do video for higher skills that is not for everyone.

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

      Completely agree with this comment

  • @koool56
    @koool56 2 года назад +1

    Wow, in first 3 minutes you already grabbed my attention by explaining overuse of OOP like no one else

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

    God bless, I'm a beginner but the sequential teaching makes everything looks as though I was a pro.😂😂🎉❤❤

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

    38:00 I think the right solution for the console output would be "flush" function
    fprintf(stdout, "message");
    flush(stdout);
    to force it printing the message.
    stdout is bufferized.

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

    Bro, C code is so clean!!!! I love it.

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

    This video is gem. Thank you for this nice video

    • @eom-dev
      @eom-dev  3 года назад

      Glad you enjoyed it!

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

    43:11 I enjoyed the keystrokes sound over your keyboard

  • @solomonbestz
    @solomonbestz 5 месяцев назад

    Still on data structure on C, After that I am going straight into this. Thanks

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

    What a cool tutorial!
    Thank you so much!
    Like seriously

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

    Very cool project! I love low level stuff.

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

    Good stuff Eric, thank you

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

    Content-Length is mandatory header, it should be kept

  • @Brad_Script
    @Brad_Script 10 месяцев назад +2

    I think the http standard expects "
    " for new lines

  • @sebastianguzman7391
    @sebastianguzman7391 2 года назад +2

    About printf("==== WAITING FOR CONNECTION ====") not works is because printf is LINE BUFFERED that means the printf needs '
    ' or the program ends to sends the current buffer to processor to be shown in the screen, grettings from Ecuador :D. I love your channel.

  • @azemazaotaru9788
    @azemazaotaru9788 2 месяца назад

    please how do I implement this in windows, I'm getting errors

  • @grimvian
    @grimvian Год назад +1

    Respect for doing the sometimes stressfull debugging on video.
    Having a ok understanding of C++, C and networking, I think it is a great video.
    Where do you get the sys/socket.h and netinet/in.h from?
    Do these h files have the ping facility?

  • @ArshdeepSingh-vf2zl
    @ArshdeepSingh-vf2zl 2 года назад

    I don't know how to host an HTML file which has an img tag inside it
    Please Help

  • @tukang2you
    @tukang2you 5 месяцев назад

    Thank you, Sir 🙏
    EOMWS = Eric O Meehan Web Server 😁😉

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

    After writing this server can we put our website on it. Or need something else.

  • @eduardabramovich1216
    @eduardabramovich1216 Год назад +1

    that white background is killing my eyes!

  • @AlFredo-sx2yy
    @AlFredo-sx2yy Год назад

    Hey i know this is an old video and it might be unlikely that you reply to me, but i have a question to ask you now that a few years have passed. I don't know if you are aware of Beej's guide to network programming in C, but basically pretty much everyone says it's the best way to learn network programming in C. In that guide tho, he uses stuff such as getaddrinfo and addrinfo instead of hard coding the information inside of sin_addr. People say that this is the preferable way to program nowadays, but most production code you can find and even code on git make use of the old method so... my question is, what is your take? is it actually better to use the old school method?

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

    the socket function returns a -1 if it gives an error

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

    I make winsock2 version, the connect is fine, but chrome make several requests to server, it make the response sometime can't reach, anyone have any idea on this?

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

    Is this project needs any additional files from ur previous videos? since I am getting an file not found error for #include and #include . Please help me with this issue.

    • @eom-dev
      @eom-dev  3 года назад +1

      Are you using Windows? You'll need to use winsock instead of socket.h. I don't know much about the library, but someone on the Discord channel may be able to help!

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

      @@eom-dev I am using windows. Please how can I join to the discord

    • @eom-dev
      @eom-dev  3 года назад

      @@minidupasan1520 Here is a link: discord.gg/PTWecyAbDU
      Specifically, I think catsanddogs has done something with winsock, but I could be mistaken.

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

      @@eom-dev Thank u. Please If u can in the future when making such great stuff please consider windows users too, I meant to mention any changes required to make in source code who are on widows. I wish u more likes and subscribers

    • @eom-dev
      @eom-dev  3 года назад +2

      @@minidupasan1520 Thank you, I appreciate it! To be honest, I think you might want to take a different perspective on this though. Unix is dominant in this space, and I would recommend using a VM of Ubuntu, an old laptop with Linux, or a Raspberry Pi when working on these kinds of projects. These are highly marketable skills - but Windows doesn't speak the same language as everyone else.

  • @nickodimcherepanov8895
    @nickodimcherepanov8895 2 года назад +1

    The definition outside of the loop is not a solution at all.
    There is not a lot of work, especially for a MacBook.
    Stack allocated memory is extremely cheap in terms of speed.

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

    I assume its called ipv4 because 2^(4+1)=32 and ipv6 cus 2^(6+1)=128

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

    Have you tried using PHP?

  • @AleemKhan-li3mr
    @AleemKhan-li3mr 3 года назад

    hello eric can you please tell me how can i write my self server i mean what languages and concepts should i learn in order to understand each and everything and able to write server. kindly refer materials and books from where i can learn all these. thank you.

    • @eom-dev
      @eom-dev  3 года назад +1

      Hi Aleem, it is really going to depend on what kind of server you are trying to set up.
      Generally speaking, there is probably a pre-built package for what you are trying to set up, so you may have better luck asking in their respective communities.
      If you are interested in network protocols, then my videos may be more useful to you. I would recommend starting by looking at the HTTP protocol and TLS.

    • @AleemKhan-li3mr
      @AleemKhan-li3mr 3 года назад

      @@eom-dev thank you so much for replying i really appreciate it. it would be very appreciated if you can make video and speak about these things so many other would benefit from that like new guys to computer science like my self. thank you once again.

  • @parikshitpatil1421
    @parikshitpatil1421 Год назад +1

    One of the best way of doing debugging is print statements. 😂😂😂 Me too. But on stderr not stdout.

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

    29:21 This is supper late , but u asked about if there's a cleaner way to print strings/arrays/pointed string , you can use puts(char* ), as it spouse to print a char* type.
    usage , puts(buffer);

  • @naushadc.k.8851
    @naushadc.k.8851 3 месяца назад

    Good...
    Is this supports HTTPS ?

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

    bro is genious

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

    "Oh yeah it never works the first time" :D

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

    Thanks!

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

    I'm just curious: why don't you use typedef struct? It's save you a lot of typing.... And, why don't you copy/paste your prototypes to avoid all of the typing and potential bugs?

  • @helloworld-fv8kx
    @helloworld-fv8kx 2 года назад

    how to make https ?

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

    ipv5 was never adopted as the standard hence why we ignored it

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

    Nice

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

    What IDE is this ?

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

    Can I get your source code?

    • @eom-dev
      @eom-dev  3 года назад +3

      You may! github.com/HomoDeusOfficial/hdelibc/tree/working

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

    too bright my eyes hurt

    • @eom-dev
      @eom-dev  2 года назад +1

      lol I would agree with you these days.

  • @alexantollin564
    @alexantollin564 11 месяцев назад

    https server? ssl tls considered

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

    Bro did you not know you need
    ... or you could do flush(stdout); for printf xd

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

    You've misunderstood. You are clearly using .cpp files instead of only .c files. C++ is not the same as C. Sorry to be the one to tell you.