[{"data":1,"prerenderedAt":471},["ShallowReactive",2],{"project-35966680":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":41,"post_text":43,"what":44,"said":60,"maker_in_thread":125,"shape":137,"grid":141,"attempts":433,"same_week":434,"maker_shows":42,"maker_hidden":463,"reader_version":464,"card":465},"35966680","lkwebserver","A little web server in C","title","Show HN: A little web server in C","https:\u002F\u002Fgithub.com\u002Frobdelacruz\u002Flkwebserver","github.com","robdelacruz",1684265862,2023,178,116,327,3109,11,"notable","infrastructure","web server","cli",[24,25,26,27],"c web server","cgi","reverse proxy","select multiplexing","curious",-0.061,{"positive":31,"neutral":32,"mixed":31,"critical":33},1,12,2,16,{"docs":36,"execution":38,"performance":39,"idea":40},{"positive":37,"critical":37},0,{"positive":37,"critical":37},{"positive":37,"critical":31},{"positive":37,"critical":31},[37,42,42,37,37,37,37,37,37,37,37,37,42,37,37,37,37,37,37,37,37,37,37,37,42,37,37,42,42,31,42,42,42,37,37,37,37,42,37,37],3,"A little web server written in C for Linux.\n\nSupports: CGI, Reverse Proxy.\n\nSingle threaded using I\u002FO multiplexing (select).",{"problem":45,"audience":45,"pricing":45,"motivation":46,"time_to_build":45,"stack":53,"openness":59,"stage":59,"team_size":59},null,{"value":47,"source":48,"evidence":49},"Writing in C is fun and feels like you can do anything in it","maker",[50],{"id":51,"by":11,"text":52},"35984807","Confession: I write in C because it's fun and feels like you can do anything in it. Agree it's probably not the most practical or commercial-friendly solution. I like C!",[54],{"value":55,"source":48,"evidence":56},"C",[57],{"id":58},"post","unknown",{"praise":61,"objections":74,"requests":89,"questions":94,"alternatives":99},[62],{"value":63,"source":64,"evidence":65},"Interesting small project, useful reference for minimal web servers","commenter",[66,70],{"id":67,"by":68,"text":69},"35967888","rahmeero","Interesting. Would be good to get more info, beyond having to read the code. Curious to know how it compares to micro_httpd [1] which is about 200 lines of C. Or others like…",{"id":71,"by":72,"text":73},"35968249","forgotmypw17","Thank you so much for sharing this! This is exactly the type of web server I'm looking for my project.",[75,82],{"value":76,"source":64,"evidence":77},"select() has a 1024 file descriptor limit; poll or epoll is better",[78],{"id":79,"by":80,"text":81},"35971928","amadvance","Take care that select() is not good for a webserver. From manpage: ``` WARNING: select() can monitor only file descriptors numbers that are less than FD_SETSIZE (1024)—an…",{"value":83,"source":64,"evidence":84},"Rust can match this performance more safely",[85],{"id":86,"by":87,"text":88},"35973032","stevefan1999","I hate to say it, old man, we have Rust today and we can do things as efficient and as performant as you while being safer overall. We have tokio to handle all the IO stuff, we…",[90],{"value":91,"source":64,"evidence":92},"Benchmarks against other small web servers",[93],{"id":67,"by":68,"text":69},[95],{"value":96,"source":64,"evidence":97},"How does it compare to micro_httpd, thttpd and tiny_httpd",[98],{"id":67,"by":68,"text":69},[100,104,111,118],{"value":101,"source":64,"evidence":102},"micro_httpd, thttpd, tiny_httpd",[103],{"id":67,"by":68,"text":69},{"value":105,"source":64,"evidence":106},"httpdito",[107],{"id":108,"by":109,"text":110},"35970317","kragen","if you like this, you might like httpdito http:\u002F\u002Fcanonical.org\u002F~kragen\u002Fsw\u002Fdev3\u002Fhttpdito-readme http:\u002F\u002Fcanonical.org\u002F~kragen\u002Fsw\u002Fdev3\u002Fserver.s it's a 2-kilobyte executable written…",{"value":112,"source":64,"evidence":113},"althttpd",[114],{"id":115,"by":116,"text":117},"35968308","sgloutnikov","Here's also althttpd [0]. Heard Richard Hipp mention it and fossil in an interview. [0] https:\u002F\u002Fsqlite.org\u002Falthttpd\u002Fdoc\u002Ftrunk\u002Falthttpd.md",{"value":119,"source":64,"evidence":120},"dufs",[121],{"id":122,"by":123,"text":124},"35969911","password4321","I use dufs when I need a webserver for minor things, and reverse proxy to it through Caddy if things get serious enough to need an SSL certificate. https:\u002F\u002Fgithub.com\u002Fsigoden\u002Fdufs",{"comments":126,"answered":33,"key":127},4,[128,131,134],{"id":129,"text":130},"35984734","Thanks, much of the asserts were scaffolding while I was programming the helper functions. They function similar to comments, reminding me of the internal conditions that should…",{"id":132,"text":133},"35984782","Thanks for this. Saw the bug you logged on github too. Agree that poll() should be used instead to avoid the FD_SETSIZE limitation. Maybe in the future when littlekitten…",{"id":135,"text":136},"35972414","This site has a good tutorial for this. It recommends vultr (which is what I use), for $2.50 - $5 a month. https:\u002F\u002Flandchad.net\u002F",{"commenters":138,"max_depth":32,"maker_replies":126,"first_comment_mins":139,"lifespan_hours":140},65,101,52,[142,146,150,153,156,158,161,164,167,170,173,175,178,180,182,184,186,188,191,194,197,200,203,205,208,210,212,215,218,220,222,224,227,230,233,237,240,243,246,249,252,255,257,260,262,265,267,270,272,274,277,280,283,285,288,290,292,294,296,298,300,302,304,306,308,310,313,315,319,322,324,326,329,332,335,337,340,343,345,348,350,352,355,357,358,361,363,367,370,372,376,380,384,387,390,393,396,398,401,402,404,407,410,412,416,419,421,425,427,429,431],[143,37,37,144,145,37],"35968598","other\u002Fneutral\u002Fnone","samtho",[147,37,37,148,149,37],"35968652","commenter\u002Fneutral\u002Fnone","skaushik92",[151,37,42,152,145,37],"35968748","project\u002Fneutral\u002Fnone",[154,37,37,148,155,37],"35969120","fsckboy",[157,37,37,148,145,37],"35971319",[159,37,42,160,149,37],"35973425","project\u002Fneutral\u002Fdocs",[162,37,37,144,163,37],"35969212","GuB-42",[165,37,37,144,166,37],"35969785","wahern",[168,37,37,148,169,37],"35971369","bongobingo1",[171,37,37,148,172,37],"35971635","friendzis",[174,37,37,148,166,37],"35971823",[176,37,37,148,177,37],"35972474","gpderetta",[179,37,37,148,172,37],"35973544",[181,37,37,148,177,37],"35974065",[183,37,37,148,172,37],"35975597",[185,37,37,148,177,37],"35976148",[187,37,37,148,172,37],"35976721",[189,37,37,144,190,37],"35972546","pjc50",[192,37,37,144,193,37],"35972843","msla",[195,37,37,144,196,37],"35973840","mananaysiempre",[198,37,37,144,199,37],"35971748","1vuio0pswjnm7",[201,37,37,144,202,37],"35969442","sharikone",[204,37,37,144,109,37],"35970285",[206,37,37,144,207,37],"35970627","paulddraper",[209,37,37,144,145,37],"35971341",[211,37,37,144,207,37],"35982119",[213,37,37,144,214,37],"35972084","jacquesm",[216,37,37,144,217,37],"35973281","cpach",[219,37,37,144,214,37],"35974042",[221,37,37,144,217,37],"35977422",[223,37,37,144,214,37],"35977545",[225,37,37,144,226,37],"35972223","treve",[228,37,37,144,229,37],"35973652","ttymck",[231,37,37,144,232,37],"35975769","raxxorraxor",[234,31,42,235,236,37],"35968525","project\u002Fmixed\u002Fnone","skulk",[238,31,37,144,239,37],"35968774","xmonkee",[241,31,37,144,242,37],"35968896","le-mark",[244,31,37,144,245,37],"35969290","ranger_danger",[247,31,37,144,248,37],"35968944","alex_lav",[250,31,37,144,251,37],"35969088","2h",[253,31,37,144,254,37],"35969156","vore",[256,31,37,148,251,37],"35969231",[258,31,37,148,259,37],"35969348","emodendroket",[261,31,37,148,254,37],"35969416",[263,31,37,148,264,37],"35969598","svnpenn",[266,31,37,148,248,37],"35969665",[268,31,37,144,269,37],"35970218","brickteacup",[271,31,37,144,254,37],"35977090",[273,31,37,144,248,37],"35969567",[275,31,37,144,276,37],"35970110","mst",[278,31,37,144,279,37],"35971171","throwaway2037",[281,31,37,144,282,37],"35970004","kerkeslager",[284,31,37,144,279,37],"35971139",[286,31,37,144,287,37],"35971949","doctor_eval",[289,31,37,144,282,37],"35976361",[291,31,37,144,251,37],"35980804",[293,31,37,144,248,37],"35981533",[295,31,37,144,282,37],"35981839",[297,31,37,144,287,37],"35981415",[299,31,37,144,282,37],"35981675",[301,31,37,148,287,37],"35982330",[303,31,37,148,282,37],"35983323",[305,31,37,148,287,37],"35984611",[307,31,37,148,282,37],"35988285",[309,31,37,148,248,37],"35981993",[311,31,37,148,312,37],"35970846","earthboundkid",[314,31,37,148,248,37],"35971013",[316,31,42,317,318,37],"35968970","project\u002Fneutral\u002Fexecution","dajtxx",[320,31,42,317,321,37],"35969580","denotational",[323,31,37,148,177,37],"35972566",[129,31,37,325,11,31],"maker\u002Fneutral\u002Fexecution",[327,31,37,144,328,37],"35969554","userbinator",[330,31,37,144,331,37],"35969811","jeremyjh",[333,31,37,144,334,37],"35970054","favorited",[336,31,37,144,312,37],"35970840",[338,31,37,144,339,37],"35971474","tomcam",[341,31,42,317,342,37],"35970263","jerrysievert",[344,31,37,144,190,37],"35972555",[346,31,37,148,347,37],"35969577","krapp",[67,33,42,349,68,37],"project\u002Fneutral\u002Fperformance",[79,42,31,351,80,37],"project\u002Fcritical\u002Fperformance",[353,42,37,354,190,37],"35972537","commenter\u002Fneutral\u002Fperformance",[132,42,37,356,11,31],"maker\u002Fneutral\u002Fperformance",[108,126,42,152,109,37],[359,126,37,144,360,37],"35971930","jaza",[115,362,42,152,116,37],5,[364,365,42,152,366,37],"35969523",6,"davidw",[368,365,37,144,369,37],"35970489","imran-iq",[122,371,42,152,123,37],7,[373,374,37,144,375,37],"35968493",8,"qwertywert_",[377,378,42,152,379,37],"35969305",9,"leetrout",[381,382,37,144,383,37],"35968305",10,"lionkor",[385,18,37,144,386,37],"35969160","adamrezich",[388,18,37,144,389,37],"35969366","torstenvl",[391,18,37,144,392,37],"35969545","zokier",[394,18,37,144,395,37],"35971552","schemescape",[397,18,37,144,386,37],"35979618",[399,18,37,144,400,37],"35971584","lelanthran",[135,18,37,144,11,31],[403,18,37,144,386,37],"35979473",[405,18,37,144,406,37],"35974228","easytiger",[408,18,37,144,409,37],"35976741","gwking",[71,32,362,411,72,37],"project\u002Fpositive\u002Fnone",[413,414,42,152,415,37],"35974485",13,"icar",[86,417,31,418,87,37],14,"project\u002Fcritical\u002Fidea",[420,417,37,144,406,37],"35973881",[422,417,37,423,424,37],"35974030","commenter\u002Fpositive\u002Fidea","capableweb",[426,417,37,144,232,37],"35975907",[428,417,37,144,406,37],"35995695",[51,417,37,430,11,31],"maker\u002Fpositive\u002Fnone",[432,417,37,144,87,37],"35985107",[],[435,440,445,450,455,459],{"id":436,"name":437,"points":438,"category":439},"35905437","Boring Report",1166,"productivity",{"id":441,"name":442,"points":443,"category":444},"35976488","Beepberry",731,"hardware",{"id":446,"name":447,"points":448,"category":449},"35948462","Willow",581,"ai",{"id":451,"name":452,"points":453,"category":454},"35904734","Moderator Mayhem",221,"learning_science",{"id":456,"name":457,"points":458,"category":20},"35958715","Oblivus GPU Cloud",193,{"id":460,"name":461,"points":462,"category":444},"35964281","My solar-powered, ePaper digital photo frame",154,false,"v2",{"id":466,"name":5,"line":6,"ai":463,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":467,"top":18,"kw":468,"maker":11,"domain":10,"tier":19,"attempts":37,"strip":469,"url":9,"mix":470,"praise":63,"objection":76,"sub":21},35966680,-0.06,[24,25,26,27],"0330000000003000000000003003313330000300",[31,32,31,33],1793991065819]