[{"data":1,"prerenderedAt":692},["ShallowReactive",2],{"project-41642151":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":35,"aspects":36,"strip":47,"post_text":49,"what":50,"said":82,"maker_in_thread":209,"shape":219,"grid":222,"attempts":650,"same_week":655,"maker_shows":48,"maker_hidden":684,"reader_version":685,"card":686},"41642151","blogtech","Hosting my website using my C web server","title","Show HN: Hosting my website using my C web server","https:\u002F\u002Fgithub.com\u002Fcozis\u002Fblogtech","github.com","cozis",1727221170,2024,303,155,203,3515,6,"legend","infrastructure","web server","other",[24,25,26,27],"c web server","http server","self-hosted","https server","debated",0.087,{"positive":31,"neutral":32,"mixed":33,"critical":34},15,22,0,13,50,{"execution":37,"performance":40,"idea":42,"docs":44,"design":45,"privacy":46},{"positive":38,"critical":39},4,1,{"positive":38,"critical":41},3,{"positive":43,"critical":39},5,{"positive":33,"critical":39},{"positive":33,"critical":41},{"positive":33,"critical":38},[33,33,33,33,33,33,33,33,33,33,43,41,43,43,33,33,41,43,39,33,33,43,41,41,43,48,48,33,41,38,33,39,41,43,48,33,41,48,39,43],2,null,{"problem":49,"audience":49,"pricing":49,"motivation":51,"time_to_build":49,"stack":62,"openness":79,"stage":80,"team_size":81},{"value":52,"source":53,"evidence":54},"Fun side project; maker enjoys building their own tools.","maker",[55,58],{"id":56,"by":11,"text":57},"41642171","Hello everyone! This is a fun little project I started in my spare time and thought you'd appreciate :)",{"id":59,"by":60,"text":61},"41646252","seumars",">I enjoy making my own tools and I'm a bit tired of hearing that everything needs to be \"battle-tested.\" So what it will crash? Bugs can be fixed :^) I love it",[63,73],{"value":64,"source":65,"evidence":66},"C","inferred",[67,69],{"id":68},"post",{"id":70,"by":71,"text":72},"41643242","SPascareli13","Only 3.4k of C code for a full http and https server? I honestly thought you would need a lot more for it to be fully compliant with the spec.",{"value":74,"source":53,"evidence":75},"poll()",[76],{"id":77,"by":11,"text":78},"41651213","> I used to think (well, I still do) that getting a barebones service up and running using the system APIs at the lowest level like this is so satisfying. It's sort of magical,…","unknown","launched","solo",{"praise":83,"objections":115,"requests":145,"questions":161,"alternatives":173},[84,93,104],{"value":85,"source":86,"evidence":87},"Impressively small codebase for a full HTTP\u002FHTTPS server","commenter",[88,89],{"id":70,"by":71,"text":72},{"id":90,"by":91,"text":92},"41645758","rwmj","Cool! I also wrote my own C web server (sources linked below) which ran a commercial website for a while. It's amazing how small and light you can make an HTTP\u002F1.1 webserver. The…",{"value":94,"source":86,"evidence":95},"Fun and educational to build an HTTP server from scratch",[96,100],{"id":97,"by":98,"text":99},"41646431","brennopost","Making a HTTP\u002F1.1 server is so fun and teaches so much about networking. I highly recommend anyone interested in networking or web development give it a try.",{"id":101,"by":102,"text":103},"41644776","gonzus","Kudos for your project -- it is great fun and a learning experience to implement your own HTTP server in a low(er)-level language. One question: you say that \"Transfer-Encoding:…",{"value":105,"source":86,"evidence":106},"Survived the HN front page traffic",[107,111],{"id":108,"by":109,"text":110},"41643407","greenavocado","Finally a website that doesn't crash when it shows up on the front page",{"id":112,"by":113,"text":114},"41643309","xyst","looks like it’s survived the HN front page hug. Congrats.",[116,131,138],{"value":117,"source":86,"evidence":118},"Reverse proxies add useful features like TLS, caching and rolling deploys, which this server lacks",[119,123,127],{"id":120,"by":121,"text":122},"41646137","xmodem","> No reverse proxies required! This is one that has always baffled me. If there's no specific reason that a reverse proxy is helpful, I will often hang an app with an embedded…",{"id":124,"by":125,"text":126},"41647781","okasaki","You're missing vhosts, TLS, caching, logging, and log analysis, access control, rate limiting, custom error messages, metrics, etc.",{"id":128,"by":129,"text":130},"41647009","dartos","I don’t really care think there is a general case for all servers. For the minimal case you don’t need it, but in production (with a single host) it allows for rolling releases,…",{"value":132,"source":86,"evidence":133},"Not advisable for production use",[134],{"id":135,"by":136,"text":137},"41643526","danpalmer","> Show HN: Hosting my website using my own C web server \"But if you actually do this, WAT\" – https:\u002F\u002Fwww.destroyallsoftware.com\u002Ftalks\u002Fwat As with much of HN, this is fun, a good…",{"value":139,"source":86,"evidence":140},"README benchmark against nginx seems misleading",[141],{"id":142,"by":143,"text":144},"41645200","ifail_for_fun","cool project, but the readme has a disingenuous comparison bench against nginx. why even put it there?",[146,154],{"value":147,"source":86,"evidence":148},"Support chunked transfer encoding or explain the 411 choice",[149,150],{"id":101,"by":102,"text":103},{"id":151,"by":152,"text":153},"41650981","jpc0","> No Transfer-Encoding: Chunked (responds with 411 Length Required, prompting the client to resend with Content-Length I've always wanted to undertake a project similar to this…",{"value":155,"source":86,"evidence":156},"Embed HTML content in the binary instead of reading from filesystem",[157],{"id":158,"by":159,"text":160},"41643198","marcodiego","How about embedding the contents of the HTML files so that no access to the filesystem is required? That would make it not only faster but also safer.",[162,166],{"value":163,"source":86,"evidence":164},"Why 411 Length Required for chunked encoding instead of supporting it",[165],{"id":101,"by":102,"text":103},{"value":167,"source":86,"evidence":168},"Why build this instead of using nginx or Apache",[169],{"id":170,"by":171,"text":172},"41645650","cynicalsecurity","Why? How is this better than running nginx or Apache2?",[174,182,189,196,203],{"value":175,"source":86,"evidence":176},"nginx",[177,181],{"id":178,"by":179,"text":180},"41644726","v3ss0n","Nginx is C web server.",{"id":170,"by":171,"text":172},{"value":183,"source":86,"evidence":184},"lighttpd",[185],{"id":186,"by":187,"text":188},"41647481","synergy20","I use lighttpd which is lighter and simpler than nginx",{"value":190,"source":86,"evidence":191},"Kore",[192],{"id":193,"by":194,"text":195},"41647706","petee","Aside, if you want to write C apps but aren't comfortable writing the public facing parts, 'Kore' is a great framework with some handy builtins like ACME cert management, Pgsql,…",{"value":197,"source":86,"evidence":198},"althttpd",[199],{"id":200,"by":201,"text":202},"41643553","litbear2022","You may be interested in this https:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=27431910 > As of 2024, the althttpd instance for sqlite.org answers more than 500,000 HTTP requests per day…",{"value":204,"source":86,"evidence":205},"Caddy",[206],{"id":207,"by":121,"text":208},"41646381","Jetty implements both TLS and compression, though in environments where I don't already have automated certificate issuance infrastructure in place I have occasionally deployed…",{"comments":210,"answered":48,"key":211},7,[212,215,218],{"id":213,"text":214},"41651159","httpdito looks incredible",{"id":216,"text":217},"41651084","Hey, the code looks really good! Thanks for sharing. I'll probably go through it a bit later :) P.S. Love the indentation",{"id":56,"text":57},{"commenters":220,"max_depth":210,"maker_replies":210,"first_comment_mins":41,"lifespan_hours":221},112,139,[223,225,229,231,234,237,239,242,245,247,249,252,255,257,260,263,266,269,271,274,276,277,281,284,285,289,292,295,298,301,303,306,309,312,315,318,321,323,327,330,332,335,338,340,342,344,346,349,353,355,357,361,365,368,371,374,377,379,382,385,388,391,394,396,398,400,402,403,404,408,411,415,418,421,424,427,429,433,436,439,441,443,444,446,449,452,455,458,462,465,468,470,473,476,480,484,488,491,494,498,500,503,506,509,512,515,518,520,523,525,528,529,531,533,537,541,544,547,550,553,556,558,561,563,565,567,569,571,575,579,581,583,584,587,590,594,596,599,601,603,608,612,615,617,620,625,628,631,633,638,640,643,646,648],[120,33,33,224,121,33],"other\u002Fneutral\u002Fidea",[226,33,33,227,228,33],"41646151","other\u002Fneutral\u002Fperformance","arielcostas",[207,33,33,230,121,33],"other\u002Fneutral\u002Fnone",[232,33,33,227,233,33],"41646444","fny",[235,33,33,236,121,33],"41646509","commenter\u002Fneutral\u002Fnone",[238,33,33,236,233,33],"41646896",[240,33,33,236,241,33],"41648120","rollcat",[243,33,33,227,244,33],"41646483","zeroCalories",[246,33,33,236,121,33],"41646578",[248,33,33,236,244,33],"41647124",[250,33,33,230,251,33],"41646313","cybrox",[253,33,33,230,254,33],"41646440","cbm-vic-20",[256,33,33,230,129,33],"41646943",[258,33,33,230,259,33],"41647090","tnolet",[261,33,33,236,262,33],"41656353","deadlocked",[264,33,33,224,265,33],"41649148","MayeulC",[267,33,33,236,268,33],"41649293","anamexis",[270,33,33,236,265,33],"41650565",[272,33,33,224,273,33],"41651259","com2kid",[275,33,33,224,129,33],"41663210",[128,33,33,224,129,33],[278,33,33,279,280,33],"41647064","other\u002Fpositive\u002Fidea","lnenad",[282,33,33,227,283,33],"41648152","mistrial9",[124,33,33,230,125,33],[286,33,33,287,288,33],"41648462","other\u002Fneutral\u002Fprivacy","nickpsecurity",[290,33,33,230,291,33],"41648472","codegeek",[293,33,33,236,294,33],"41651582","TZubiri",[296,33,33,287,297,33],"41652288","OptionOfT",[299,33,33,230,300,33],"41648821","01HNNWZ0MV43FF",[302,33,33,224,265,33],"41649123",[304,33,33,287,305,33],"41649036","pengaru",[307,33,33,224,308,33],"41649850","didip",[310,33,33,236,311,33],"41650481","paxys",[313,33,33,224,314,33],"41650608","jasonjayr",[316,33,33,230,317,33],"41650897","worik",[319,33,33,230,320,33],"41651331","sophacles",[322,33,33,287,320,33],"41651216",[324,33,33,325,326,33],"41651222","other\u002Fcritical\u002Fprivacy","Klonoar",[328,33,33,236,329,33],"41651249","mp05",[90,39,43,331,91,33],"project\u002Fpositive\u002Fexecution",[333,39,43,331,334,33],"41647011","kragen",[336,39,41,337,91,33],"41647083","project\u002Fneutral\u002Fexecution",[339,39,33,224,334,33],"41647117",[341,39,41,337,91,33],"41647625",[343,39,33,224,334,33],"41648439",[213,39,33,345,11,39],"other\u002Fpositive\u002Fnone",[347,39,43,348,334,33],"41653441","maker\u002Fpositive\u002Fnone",[350,39,43,351,352,33],"41648806","project\u002Fpositive\u002Fperformance","nicoburns",[216,39,33,354,11,39],"maker\u002Fpositive\u002Fexecution",[56,48,33,356,11,39],"maker\u002Fneutral\u002Fnone",[358,48,41,359,360,33],"41642952","project\u002Fneutral\u002Fidea","yazzku",[362,48,43,363,364,33],"41645488","project\u002Fpositive\u002Fidea","sim7c00",[366,41,43,331,367,33],"41643691","theideaofcoffee",[369,41,33,230,370,33],"41645165","yard2010",[372,41,33,230,373,33],"41647930","ggliv",[375,41,33,230,376,33],"41648094","ryandrake",[378,41,33,345,367,33],"41649315",[380,41,33,381,300,33],"41649569","other\u002Fcritical\u002Fnone",[383,41,33,236,384,33],"41650621","zppln",[386,41,33,381,387,33],"41650741","the_gorilla",[389,41,33,236,390,33],"41651143","tuveson",[392,41,33,236,393,33],"41653766","pdp11ty",[77,41,33,395,11,39],"maker\u002Fneutral\u002Fexecution",[397,41,33,230,393,33],"41653790",[200,38,41,399,201,33],"project\u002Fneutral\u002Fperformance",[401,38,33,230,11,39],"41651242",[193,43,33,230,194,33],[108,18,43,351,109,33],[405,18,41,406,407,33],"41643510","project\u002Fneutral\u002Fdocs","rubyn00bie",[409,18,41,406,410,33],"41643661","wilkystyle",[412,18,39,413,414,33],"41643566","project\u002Fcritical\u002Fperformance","afavour",[416,18,39,413,417,33],"41643743","kqr",[419,18,39,413,420,33],"41643747","interroboink",[422,18,33,236,423,33],"41643807","christina97",[425,18,33,236,426,33],"41648775","eqvinox",[428,18,33,236,367,33],"41643781",[430,18,33,431,432,33],"41644566","commenter\u002Fneutral\u002Fperformance","tazjin",[434,18,33,431,435,33],"41644704","chrismorgan",[437,18,33,431,438,33],"41644740","re-thc",[440,18,33,431,435,33],"41644848",[442,18,33,230,352,33],"41648815",[59,210,43,363,60,33],[70,445,41,337,71,33],8,[447,445,33,236,448,33],"41643405","ironhaven",[450,445,33,236,451,33],"41643494","AnotherGoodName",[453,445,41,337,454,33],"41646081","sph",[456,445,33,236,457,33],"41646916","matja",[459,445,41,460,461,33],"41649073","project\u002Fneutral\u002Fnone","folmar",[463,445,41,337,464,33],"41643831","ninjin",[466,445,33,230,467,33],"41644172","cozzyd",[469,445,33,230,91,33],"41645789",[471,445,33,345,472,33],"41647583","johnisgood",[474,445,33,230,475,33],"41645701","fanf2",[477,478,33,230,479,33],"41650005",9,"panzi",[481,482,43,363,483,33],"41647283",10,"kopirgan",[485,486,33,230,487,33],"41644004",11,"Ono-Sendai",[158,489,41,490,159,33],12,"project\u002Fneutral\u002Fdesign",[492,489,41,490,493,33],"41643301","kevin_thibedeau",[495,489,39,496,497,33],"41650408","project\u002Fcritical\u002Fdesign","knowitnone",[499,489,41,490,294,33],"41651540",[501,489,39,496,502,33],"41659253","remram",[504,34,43,363,505,33],"41648583","adamrezich",[507,508,39,496,294,33],"41642998",14,[510,508,33,236,511,33],"41643130","jagged-chisel",[513,508,33,236,514,33],"41643304","heyoni",[516,508,33,236,517,33],"41643352","its-summertime",[519,508,33,236,294,33],"41651490",[521,508,33,236,522,33],"41645188","sabas123",[524,508,33,236,294,33],"41651523",[526,508,33,230,527,33],"41643466","iveqy",[101,31,41,337,102,33],[530,31,41,337,102,33],"41644956",[112,532,43,351,113,33],16,[534,535,43,363,536,33],"41643057",17,"system7rocks",[538,535,39,539,540,33],"41643222","project\u002Fcritical\u002Fprivacy","bosch_mind",[542,535,33,236,543,33],"41643278","whiterknight",[545,535,33,236,546,33],"41643367","agentultra",[548,535,33,236,549,33],"41644268","naniwaduni",[551,535,33,236,552,33],"41643530","mplewis",[554,535,33,236,555,33],"41645492","victorbjorklund",[557,535,33,236,543,33],"41647392",[559,535,41,460,560,33],"41647232","a2128",[562,535,39,539,497,33],"41650421",[564,535,33,236,502,33],"41659308",[151,566,41,337,152,33],18,[568,566,33,236,502,33],"41659286",[570,566,33,236,152,33],"41700341",[572,573,33,230,574,33],"41643523",19,"chairmansteve",[576,577,43,331,578,33],"41646108",20,"p0w3n3d",[580,577,41,399,578,33],"41646120",[97,582,33,230,98,33],21,[135,32,41,460,136,33],[585,32,39,539,586,33],"41643588","x3haloed",[588,32,41,460,589,33],"41643702","dailykoder",[591,592,33,230,593,33],"41685866",23,"Turboblack",[178,595,33,230,179,33],24,[597,595,33,230,598,33],"41645194","nineteen999",[600,595,33,230,179,33],"41668280",[186,602,33,230,187,33],25,[604,605,43,606,607,33],"41643484",26,"project\u002Fpositive\u002Fnone","ezekielmudd",[609,610,33,230,611,33],"41677261",27,"broknbottle",[142,613,39,614,143,33],28,"project\u002Fcritical\u002Fdocs",[170,616,41,359,171,33],29,[618,616,41,359,619,33],"41645666","rauli_",[621,622,39,623,624,33],"41645625",30,"project\u002Fcritical\u002Fexecution","cromulent",[626,622,33,236,627,33],"41645658","arethuza",[629,622,39,539,630,33],"41645743","justmarc",[632,622,33,395,11,39],"41645751",[634,635,39,636,637,33],"41643757",31,"project\u002Fcritical\u002Fidea","kristianpaul",[639,635,33,236,367,33],"41643772",[641,635,33,236,642,33],"41645360","Alifatisk",[644,635,33,236,645,33],"41643806","ustad",[647,635,43,351,578,33],"41646165",[649,635,33,236,11,39],"41651268",[651,652],{"id":4,"t":12,"points":14,"comments":15},{"id":653,"t":654,"points":48,"comments":39},"46343111",1766304542,[656,660,665,669,674,679],{"id":657,"name":658,"points":659,"category":20},"41635592","OpenFreeMap",848,{"id":661,"name":662,"points":663,"category":664},"41604262","Container Desktop",464,"dev_tools",{"id":666,"name":667,"points":668,"category":664},"41591018","Sidekick",452,{"id":670,"name":671,"points":672,"category":673},"41609947","Time Flies",401,"creative",{"id":675,"name":676,"points":677,"category":678},"41603865","AnySkin",390,"hardware",{"id":680,"name":681,"points":682,"category":683},"41623814","King Thirteen",269,"games",false,"v2",{"id":687,"name":5,"line":6,"ai":684,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":688,"top":18,"kw":689,"maker":11,"domain":10,"tier":19,"attempts":48,"strip":690,"url":9,"mix":691,"praise":85,"objection":117,"sub":21},41642151,0.09,[24,25,26,27],"0000000000535500351005335220340135203215",[31,32,33,34],1794036661674]