Coding a Web Server in 25 Lines - Computerphile

Поділитися
Вставка
  • Опубліковано 21 лют 2024
  • Just how simple can a web server be? Laurence Tratt, Shopify / Royal Academy of Engineering Research Chair in Language Engineering at Kings College London builds it up.
    More about Laurie: bit.ly/C_LaurenceTratt
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottscomputer
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharanblog.com
    Thank you to Jane Street for their support of this channel. Learn more: www.janestreet.com

КОМЕНТАРІ • 664

  • @AndreDeLimburger
    @AndreDeLimburger 3 місяці тому +813

    The joy of modern programming languages. Listening on a socket in just one line.

    • @sumantagogoi
      @sumantagogoi 3 місяці тому +86

      yep.. that itself was the main trick... that one line.. tcp listen..

    • @aawwmm
      @aawwmm 3 місяці тому +55

      java had that in 1995... ServerSocket for those asking
      After looking into c it has Socket.h so even in c its there...

    • @dexio85
      @dexio85 3 місяці тому +50

      It's not a programming language, it's the set of libraries it comes with. I think you are confusing two things here.

    • @AndreDeLimburger
      @AndreDeLimburger 3 місяці тому +19

      The standard libraries that come with the language, are they considered part of the language?

    • @rogo7330
      @rogo7330 3 місяці тому +24

      It's two syscalls to Linux kernel too. Not so heavy to implement that in any language that allows to do syscalls.

  • @samwalker4438
    @samwalker4438 3 місяці тому +542

    I loved Laurie’s smile each time he wrote something he knew was absolutely dodgy!

    • @AdamSpurgin
      @AdamSpurgin 3 місяці тому +10

      I write webservices for a living and I have that same energy when realizing I can cheat the system and completely ignore convention.

  • @uuu12343
    @uuu12343 3 місяці тому +554

    He is a gift that keeps on giving
    A fundamental explanation of making a simple webserver in 25 LOC for easy understanding of its components
    A lecturer that
    1. Uses Rust
    2. Uses a framework laptop
    3. USES NEOVIM
    very nice

  • @wildwestrom
    @wildwestrom 3 місяці тому +175

    Programming Rust on a Framework laptop running OpenBSD. Absolutely based.

    • @gg-gn3re
      @gg-gn3re 3 місяці тому +23

      neovim and looks like alacritty as well

    • @udasai
      @udasai 2 місяці тому +6

      I fully expected Python, the Visual Basic of the modern age. It's the only reason I clicked the link, to see if I was right, since for any modern environment you can write a "web server" with three statements: import web library, set default response string, invoke the listener.

    • @jumbledfox2098
      @jumbledfox2098 2 місяці тому +2

      incredibly based.

    • @hachikuku_
      @hachikuku_ 2 місяці тому +6

      you all sound like reddit and hn nerds absolutely cooming over a dude's setup.

    • @gg-gn3re
      @gg-gn3re 2 місяці тому +2

      @@hachikuku_That's the point, poindexter.

  • @OldShatterham
    @OldShatterham 3 місяці тому +284

    Honestly I didn't expect the fundamentals of HTTP to be so easy. This sort of "from-the-ground-up" approach was really fun to watch!

    • @GottZ
      @GottZ 3 місяці тому +17

      email is of similar complexity.

    • @Faladrin
      @Faladrin 3 місяці тому +16

      Sure, when you have libraries in place that do all the actual on the ground stuff we don't see in the video.

    • @collinswisher6566
      @collinswisher6566 3 місяці тому +13

      @@Faladrinreally the only library he used was the tcplistener implementing the protocol was all up to him.

    • @beentheredonethatunfortunately
      @beentheredonethatunfortunately 2 місяці тому

      There's a degree of knowing I.T. being seen as knowing how to use Word and Excel. Been this way for a couple of decades at least. Very few people seem to know the basics.

    • @FinalManaTrigger
      @FinalManaTrigger 9 днів тому

      What you don't see is just how involved the library calls are, there's tons more lines of code behind the listner, for example.

  • @vercolit
    @vercolit 3 місяці тому +123

    I had this professor for a few lectures in my undergrad during covid. He was very enthusiastic, funny and explained things really well. He was also was explaining concepts with his neovim + rust setup. Happy to see him again on computerphile!

  • @dylanmeeks54
    @dylanmeeks54 3 місяці тому +616

    Rust user? Framework laptop owner? Based prof.

    • @KarunaMurti
      @KarunaMurti 3 місяці тому +55

      Bet prof use Arch too btw.

    • @Lb8068
      @Lb8068 3 місяці тому +30

      Based on what?

    • @beatboy6690
      @beatboy6690 3 місяці тому +88

      Rust user, framework laptop and vim user. Mega based

    • @toby2581
      @toby2581 3 місяці тому +40

      Wonder when he's getting his bottom surgery.

    • @UnevenMike
      @UnevenMike 3 місяці тому +25

      And neovim and firefox

  • @vincei4252
    @vincei4252 3 місяці тому +1388

    You can build the web server in one line of code if you put your 25 lines of code in a library. 😂

    • @ai-spacedestructor
      @ai-spacedestructor 3 місяці тому +94

      or write all of the code in one line, even if we dont strip down the server to the bare minimum, a full server is still just 1 line of code if you format it in such a way that its all on the same line.

    • @vincei4252
      @vincei4252 3 місяці тому +63

      @@ai-spacedestructor isn't every application just one line of code/one function? main() {... } It's turtles all the way down.

    • @mail2ajm
      @mail2ajm 3 місяці тому +36

      Low level programmer:

    • @ai-spacedestructor
      @ai-spacedestructor 3 місяці тому +4

      @@vincei4252 depends on the programming language, im not too familiar with rust to know how that is exactly.

    • @zfold4702
      @zfold4702 3 місяці тому +8

      Nodejs😂

  • @halfsourlizard9319
    @halfsourlizard9319 3 місяці тому +210

    'I am abusing this monstrously.' == always the sign of well-written code.

    • @TAP7a
      @TAP7a 3 місяці тому +28

      “What I’m doing is a crime against silicon” = writing some of the most ingenious code possible to write

    • @phill6859
      @phill6859 3 місяці тому

      No, not even close

    • @phill6859
      @phill6859 3 місяці тому +2

      ​@@TAP7aif you think it's ingenuous then it's more about what you think than the code itself.

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

      Genius or, more likely, brittle code only workable by the original author. Could be either. Could be both.

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

      @@kevinmcdonough9097 Oh, very probably both 😜

  • @NetherFX
    @NetherFX 3 місяці тому +67

    The funny thing is, there's an async tutorial in the Rust Book that explains how to use threads with a web server do handle 4 workers. If I remember correctly it's not even 10 lines more. Would've been a cool addition!

    • @Gnarkson
      @Gnarkson 3 місяці тому

      which rust book?

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

      @@Gnarksonshould be chapter 20 in "the book" (referring to the official book)

    • @Gnarkson
      @Gnarkson 3 місяці тому

      @@NetherFX thanks

  • @nullptr.
    @nullptr. 3 місяці тому +33

    You can tell this guy loves what he does. Thanks for the video!

    • @Microphunktv-jb3kj
      @Microphunktv-jb3kj 3 місяці тому

      highly paid serf is a happy and productive serf... : )

  • @TheHenrik225
    @TheHenrik225 3 місяці тому +25

    Great format for explaining web servers. Those 17 minutes flew by

  • @Norman_Fleming
    @Norman_Fleming 3 місяці тому +33

    it is important to remember that whichever end you are writing, you need to consider the other end a bad actor or buggy AF.

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

      That's what he's saying.
      He's ignoring any safety concerns for this example like error handling or exploit fixing

  • @pmmeurcatpics
    @pmmeurcatpics 3 місяці тому +46

    Don't know if it's a coincidence, but the code really reminded of the one in the first chapters of the Rust Book - Building a Multithreaded Web Server. I've just been reading it a couple of weeks ago, and can definitely recommend taking a look if you're interested! Though it's worth mentioning that the code does contain some difficult Rust

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

      Difficult Rust can't be as bad as "modern" C++ with templates and meta-programming? Can it?

    • @pmmeurcatpics
      @pmmeurcatpics 3 місяці тому +5

      @@vincei4252 unfortunately I can't make this comparison since I barely know C++, let alone "modern" C++. Rust does meta-programming using things called macros - from what I've heard, they're quite powerful and reasonably easy to understand? Though they're definitely WIP, so there're a couple of rough edges here and there. There was a talk recently, called something like "Anything you can do, I can do it worse with macro_rules!", where the host showed a somewhat extreme example - a macro they created that can automatically create a fully functional XML representation of a token tree of Rust code

    • @framegrace1
      @framegrace1 3 місяці тому

      This code will be very similar on any language, really. Even the ones with no sugar added.

    • @TAP7a
      @TAP7a 3 місяці тому +2

      @@vincei4252they’re as bad as each other syntactically, Rust is probably a little more coherent, but the precision demanded by the Rust compiler is simultaneously much more reassuring and frustrating. Whereas modern C++ is less coherent, but quicker to get running, but only if you accept all the footguns that come with it.

  • @teej_dv
    @teej_dv 3 місяці тому +155

    TELESCOPE USED!! LETS GOOOOOOO!!!!!

    • @mjhika
      @mjhika 3 місяці тому +4

      TELESCOPE!!!

    • @Pbertrand_dev
      @Pbertrand_dev 3 місяці тому +11

      wait arent you teej the creator of telescope but you also stream on twitch?

    • @n0kodoko143
      @n0kodoko143 3 місяці тому +2

      Telescope, Lets GOOOOOO

    • @RenXZen
      @RenXZen 3 місяці тому +5

      timestamp 1:51 woooooooooooo

    • @DamnitDutch
      @DamnitDutch 3 місяці тому +5

      🔭 NeoVim without Telescope LITERALLY unusable 🔭

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

    This was awesome. I was a programmer, now a DBA. Having someone explain code like this is what a learning experience should be.

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

    Even before the rest was completed, just the bit that sent back "Hello Computerphile" was totally amazing to me.

  • @YandiBanyu
    @YandiBanyu 3 місяці тому +10

    I always recommend everyone trying to one up their programming skill is to create web server using the HTTP spec. It really teaches a lot about what programming is. There is a document that you have to follow and the expected behaviour, how you handle edge cases, how you optimize some algorithm, etc. Why HTTP and not anything else is jusy because the sheer number of implementation available that you can use as a reference.

    • @laptoprelaks
      @laptoprelaks 3 місяці тому

      interesting will try soon😂

  • @daze8410
    @daze8410 3 місяці тому +36

    @ThePrimeTime needs to see this

    • @taylorswe
      @taylorswe 3 місяці тому +14

      the "I'm abusing this monstrously - agen"

    • @romevang
      @romevang 3 місяці тому +6

      I think he watched it on today’s stream, we’ll see if it gets posted.

  • @Lurco8
    @Lurco8 3 місяці тому +4

    Fantastic content, that's what I was always missing in the "basic" server setup - the way the server actually functions!

  • @jearl961
    @jearl961 2 місяці тому +4

    Love seeing Rust on the channel! Not a big fan of his variable names though.

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

    I love this guy's computherphile videos! He's always very clear and bring practical stuff.

  • @linuxguy1199
    @linuxguy1199 3 місяці тому +27

    Nice! One of my first projects was writing my own webserver in Java, later added PHP support and used it to host my website.

    • @andiuptown1711
      @andiuptown1711 2 місяці тому

      How did making a Java web server go? Any tips?

  • @VivekYadav-ds8oz
    @VivekYadav-ds8oz 3 місяці тому +9

    Glad to see Rust having reached a point where it's no longer "Building a web server in Rust" but just building a web server, oh and btw we chose this whatever language because it's mainstream enough and understandable enough to not take away from the main point of the lesson.

    • @em_the_bee
      @em_the_bee 11 днів тому

      I'm sorry, you forgot to add .unwrap() and a semicolon, so your comment does not compile

  • @comosaycomosah
    @comosaycomosah 3 місяці тому +20

    this channel is fire tbh

  • @Meow_YT
    @Meow_YT 3 місяці тому +51

    "In 25 lines" is doing a lot of heavy lifting with those libraries wrapping so much networking code.

    • @CramBL
      @CramBL 3 місяці тому +11

      "Those libraries" he's using one library and it's the relatively tiny Rust standard library. Try writing to stdout in less than 25 lines without calling 50 lines of C or another binary that does just that.

    • @zerker2000
      @zerker2000 3 місяці тому +11

      ​@@CramBLNot wrong in spirit, but "call the SYS_WRITE syscall" is like 5 lines of assembly, or a hardware serial port equivalent in low-level systems

    • @Meow_YT
      @Meow_YT 3 місяці тому

      ​@@CramBLOh stop. It's just a bait title. So much is going on behind the scenes. People slowly forgetting how much work has been done by others in the past, and it boils down to "in 25 lines". It's a bit tiring. And it's all going to be forgotten if anything major happens and people don't know how to fix the problems. Cos all we'll have are the imports and no one knows the magic inside. Just 1 billion lazy devs that know the 25 lines.

    • @gg-gn3re
      @gg-gn3re 3 місяці тому

      @@CramBL yea and try doing it without a kernel, that's even more lines!

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

      Libraries like... the kernel??? That's where the whole IP stack and sockets are implemented. Even in assembly this code wouldn't be massively longer.

  • @pedroth3
    @pedroth3 3 місяці тому +4

    Like all computerphile video of Dr Laurence Tratt. Great work!

  • @AliciaSykes
    @AliciaSykes 3 місяці тому +13

    Me expecting him to run `npx http-server index.html` and be done with it 😆
    Great video, thanks Laurence!

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

      25 lines of code plus 4.6 gigs of node packages for some reason 😂

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

    Awesome video, great job at explaining the questions asked. Absolute chad energy Laurence
    Please do more videos like this!

  • @SrFrancia0
    @SrFrancia0 3 місяці тому +4

    You didn't have to flex your vim skillz that hard lmao what a legend. Also noticed the framework laptop

  • @nelioasousa
    @nelioasousa 2 місяці тому +2

    Absolutely amazing! Thank you very much, Mr. Tratt.

  • @smccrode
    @smccrode 3 місяці тому +5

    Great video! If you want to remove the duplicate INSERT mode you can add: set noshowmode into your config.

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

    Although my English is not good, I spent an afternoon watching and learning from this video. This video is really simple and easy to understand for beginners like me.

  • @bersl2
    @bersl2 3 місяці тому +12

    0:34 I am currently waist-deep in the Apache internals at work, so I can attest to this.

  • @gerokatseros
    @gerokatseros 3 місяці тому

    Best channel in you tube ... i am surprised by how well and simply everything is explained. I don't use rust but i already figured out how to do it in Python!

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

    awesome. even though i am a fullstack dev, this seemed always daunting and i never wanted to look into it but its actually super super easy. really well made!

  • @sundhaug92
    @sundhaug92 3 місяці тому +4

    One difficulty with supporting multiple sites in a webserver is that you have to support it using both raw HTTP ... and TLS SNI (ServerName Indication) and ideally TLS ESNI (Encrypted SNI)

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

    Learnt something nice today! Thanks for uploading, Lastly the authors enthusiasm regarding his craft was quite infectious.

  • @TallMoose
    @TallMoose 3 місяці тому +7

    Great video! Just a few weeks ago my collegues and I were chatting about a web project I was working on, and the question of "How exactly does a web server even work?" came up. At the time we didn't look too deep into it, since we are all high level programmers who don't remember our college days. This really pointed out how simple you can really do it!

  • @Simon-ir6mq
    @Simon-ir6mq 3 місяці тому

    This was really nice! I'm so used to getting everything low-level served to you as a library call when you actually need so little of the library you could just do the thing yourself.

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

    Wow, this is exactly what I needed. You're a lifesaver!

  • @PatrickPoet
    @PatrickPoet 2 місяці тому +1

    "you could call it a good listener," you startled a laugh out loud out of me:) Thanks.

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

    Loved this episode!. Thanks.

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

    Great to see someone coding in rust! Thank you. 🙏🏻

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

    Didn't expect the video to include the Rust programming language. As always valuable materials presented for pure knowledge:)

  • @HarryHelsing
    @HarryHelsing 3 місяці тому +23

    Rust and Neovim, I like your style.

    • @PbPomper
      @PbPomper 3 місяці тому +2

      Can't get used to Rust syntax.

  • @Vl_OLET
    @Vl_OLET 3 місяці тому

    no way y’all happened to upload the exact type of thing i’ve been looking for lately

  • @dehrk9024
    @dehrk9024 2 місяці тому

    I love listening to these smart people it's so motivation and takes you into the presence, sharpening your mind..

  • @DoRullings
    @DoRullings 3 місяці тому +14

    They could do a http path traversal, e.g.: [address to server]/../../../../etc/passwd

    • @Turalcar
      @Turalcar 3 місяці тому

      I think you could just start with // to get to the root

    • @sofianikiforova7790
      @sofianikiforova7790 3 місяці тому

      He acknowledged this insecurity.

    • @DoRullings
      @DoRullings 3 місяці тому

      @@sofianikiforova7790 Yes he does. I only showed one way to access directories you don't want other people to access. It wasn't meant as a "gotcha" moment. 😉

    • @DoRullings
      @DoRullings 3 місяці тому

      ​@@Turalcar I'm not sure if it would have worked on that server, tbh. In any case, I would have written the comment in the same way as it makes it easier to read/recognize, and UA-cam comments are not suitable for this as anything resembling a URL is easily caught by the scam filter.

  • @DevduttShenoi
    @DevduttShenoi 3 місяці тому +16

    This guy's the kinda professor I wanted all my academic life!
    nvim, rust in linux on a framework laptop!
    Be my guide sensei 😭❤

    • @wbfaulk
      @wbfaulk 3 місяці тому +4

      Pretty sure he was running FreeBSD, based on the browser's "user-agent", not Linux.

    • @gspapp
      @gspapp 3 місяці тому

      OpenBSD @@wbfaulk

    • @smikkelbeer6352
      @smikkelbeer6352 3 місяці тому +2

      ​@@wbfaulk OpenBSD, even

    • @wbfaulk
      @wbfaulk 3 місяці тому

      @@smikkelbeer6352 dammit

  • @cthoadmin7458
    @cthoadmin7458 Місяць тому

    Tried it and damn! It worked! Utterly brilliant. What a fantastic way to learn! Yesterday it was Rust hello world for me, now I have a basic web server running.

  • @Lion_McLionhead
    @Lion_McLionhead 3 місяці тому +4

    Remember the good old days when writing a 1 line web server in perl was the rage.

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

    Great video, loved it!

  • @marcruijs1039
    @marcruijs1039 3 місяці тому

    Love seeing the framework laptop!

  • @MJ-xh8co
    @MJ-xh8co 3 місяці тому

    I did the same project for a distributed systems course. What a great small project.

  • @addas4
    @addas4 3 місяці тому +2

    Thank you! You gave me courage!

  • @codewizard58
    @codewizard58 3 місяці тому +2

    You can make a secure web site with about 60 lines of C that is extensible. Did this 28 years ago and was used as part of one the the first internet proxy firewalls.

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

    I don't know why, but I just thought about how to make a web server and this video came up. What a coincidence!

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

    simple and to the point. nice!

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

    ive always loved how "gobblygoop" is an official industry term

  • @rtdietrich
    @rtdietrich 2 місяці тому +1

    Very nice! thank you

  • @polarfamily6222
    @polarfamily6222 2 місяці тому +1

    Kudos on using a part oh The VIM family! I also really need to look more at rust 🤣👍

  • @metcaelfe
    @metcaelfe 2 місяці тому +1

    Oauth clients are an incredibly useful implementation of these

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

    I like this transition. We went from Perl one liners or insane algorithimic one liners to now people applying creativity to web servers and api designs. I was just thinking about how computer science is getting boring nowadays but I’m glad that there’s still a few breaths left until it totally becomes the next accounting-esque profession.

    • @sofianikiforova7790
      @sofianikiforova7790 3 місяці тому

      I’m not sure it will ever be an accounting-esque profession. The amount of creativity involved and flexibility of tooling, and solutions are always going to be more open ended than accounting.

    • @yugshende3
      @yugshende3 3 місяці тому

      @@sofianikiforova7790 I agree but I think the creativity part of it is tied behind the language. once people can code in their native languages I think more or less the syntactical accuracy will become a matter of just putting the right structure in place. So, more or less like accounting. Similarly how people still do creative stuff with accounting (eg new ways of building ledgers like crypto) but the basic premise has converged onto a more or less singular agreed-upon convention. Computer Science was fighting that premise at its very core I think with several languages and several programming paradigms. But with the advent of AI the programming paradigms or "code structure" might become meaningless. A computer for example doesn't care if the JS file is minified or beautified. We do.

  • @varantavers
    @varantavers 3 місяці тому +12

    Rust mentioned, uses Framework. Instant like.

  • @RoyRope
    @RoyRope 3 місяці тому

    Very nice explanation.

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

    I wish I could give this video more than one like. It's that good!

  • @SeniorScriptKitty
    @SeniorScriptKitty Місяць тому

    much obliged, i appreciate it.

  • @slendi9623
    @slendi9623 3 місяці тому +2

    11:58 this path traversal makes me cry

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

    Thanks for the beginner friendly Rust tutorial!

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

    Neovim for the win! That's some serious productivity!

  • @GoKotlinJava
    @GoKotlinJava 3 місяці тому

    Very nice. Loved the video,

  • @ddude27
    @ddude27 3 місяці тому

    Crazy to think we've abstracted all the low level aspects for creating a web server. Just going through all the standards/protocols invented to get this web server going that looks simplistic would take a lot of computer science courses to get a deep understanding of it all.

  • @deadlock107
    @deadlock107 3 місяці тому

    Recreated it in python and learned a lot. Thank You!

  • @patrickle2500
    @patrickle2500 3 місяці тому

    You have taught more about general services (it doesn’t have to be for web) than college ever did for me

  • @EmanuelRaziel
    @EmanuelRaziel 2 місяці тому +1

    Thank you a lot!

  • @abcde...7960
    @abcde...7960 2 місяці тому +1

    It is an interesting video thanks for sharing.

  • @tmnt9001
    @tmnt9001 3 місяці тому

    First of all, fantastic video. It's amazing how you managed to simplify such a complex topic.
    Second of all - as a software engineer - your corner cutting made my skin crawl. 😅

  • @taylor1038
    @taylor1038 3 місяці тому

    Love the Framework laptop!

  • @damirparipovic5179
    @damirparipovic5179 3 місяці тому

    Uses Rust and Nvim w/ gruvbox colours? Absolutely based professor.

  • @dougclendening5896
    @dougclendening5896 3 місяці тому

    Realizing that someone needed to program the libraries you were using feels like a lost art.
    We stand on the shoulder of giants.

  • @shoaib_zubair
    @shoaib_zubair 3 місяці тому +2

    love your shirt pattern.

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

    What (Neo)Vim plugins did you use? That’s a great looking setup.

  • @itwsntme
    @itwsntme 2 місяці тому +1

    That was very clear

  • @groverphonic
    @groverphonic 3 місяці тому

    Good to see another openBSD enjoyer :)

  • @kil98q
    @kil98q 3 місяці тому

    Love that framework laptop you got there ;) got one too.

  • @wcheswick
    @wcheswick 3 місяці тому

    Lovely sample. I used to do all this with a shell script. Same approach, and potentially quite safe.

  • @emjizone
    @emjizone 3 місяці тому

    Laurence Tratt and @Computerphile, I hope you'll soon make a video explain how an why this naive server is so damn *vulnerable* to many sorts of attacks, particularly BF, DoS and LL attacks.

  • @speakertoanimals
    @speakertoanimals 3 місяці тому

    Great presentation! I came for the httpd teaser, I left with my first appreciation of Rust.

  • @BillySugger1965
    @BillySugger1965 2 місяці тому +1

    What I want to know it, how to connect a TCP socket to a serial COM port and then write a crude web server on an Arduino to simplify remote connections to embedded projects.

  • @sabuein
    @sabuein 3 місяці тому

    Thank you.

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

    What's the line merging referred at 7:30? I don't think I've ever heard of that

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

    10:50 you could use the split_whitespace() function 😊

  • @pixalquarks4623
    @pixalquarks4623 3 місяці тому

    I too made a http server, which was just a todo api app. Learnt how http request actually works and parsing them. Fun project, got to learn a lot. Wanted to learn on the security part of this, any insights or references to look into?

  • @coutinhotiago
    @coutinhotiago 2 місяці тому +1

    I love production ready code 🙂

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

    While its nice to see this broken down for people, I also want to stress how dangerous this is without proper security and exploit handling. It is almost always better to implement some well known http server library if you need this functionality.
    It's not just handling files to have basic security here. There are all sorts of RCE via injection you have to be concerned with, etc, depending on which language you implement this in.
    However, this is a great exercise for learning this!

  • @danielAgorander
    @danielAgorander 3 місяці тому +2

    Using a slightly different one eh? I checked, and I spot some OpenBSD httpd! High Five Laurence Tratt!
    (And OpenBSD does run very nice on the Framework laptop. :D )

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

    The Go standard library says hello :)

  • @RetroRogersLab
    @RetroRogersLab 3 місяці тому

    Would you say there is a use case for this in Internet of Things projects? I've heard of MQTT and other messaging technologies but for a private home network behind a firewall this is pretty low point of entry. I guess I should look into Rust and add that to my Resume too.

  • @landspide
    @landspide 3 місяці тому

    Brilliant!