Why? How is this better than running nginx or Apache2?
Show HN: Hosting my website using my C web server
61–70 of 160 posts
Re: Show HN: Hosting my website using my C web server
#62Only 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.
Re: Show HN: Hosting my website using my C web server
#63Great project. Down for me. $ curl http://playin.coz.is/index.html curl: (7) Failed to connect to playin.coz.is port 80 after 166 ms: Couldn't connect to server
Re: Show HN: Hosting my website using my C web server
#64Great project. Down for me. $ curl http://playin.coz.is/index.html curl: (7) Failed to connect to playin.coz.is port 80 after 166 ms: Couldn't connect to server
Re: Show HN: Hosting my website using my C web server
#65He mentions bots make great fuzzers, but I think he should also do a bit of actual fuzzing.
http://git.annexia.org/?p=rws.git;a=tree Requires: http://git.annexia.org/?p=c2lib.git;a=tree http://git.annexia.org/?p=pthrlib.git;a=tree
Re: Show HN: Hosting my website using my C web server
#66Only 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.
I wrote a simple embedded C webserver to provide a liveview of data acquisition for one of my experiments that weighs in at <250LOC. Ok, I wouldn't put it on the public internet, and it only implements a small fraction of HTTP/1.1, but it works and only requires mallocing at initialization...
Re: Show HN: Hosting my website using my C web server
#67Only 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.
Http/1.1 is dead simple if you ignore most of the spec. If you only take get requests and set content-length on response you will be good for 99% of user agents. It’s not much more code to handle the transfer-encoding and byte-range headers. HTTPS is just http over a tls socket which is the level of abstraction you should have if you don’t roll your own crypto. It’s fun and not that bad really.
Everybody speaks HTTP/1.0 and it is even simpler.
Re: Show HN: Hosting my website using my C web server
#68 #define LIT(S) ((string) {.data=(S), .size=sizeof(S)-1})
#define STR(S) ((string) {.data=(S), .size=strlen(S)})Re: Show HN: Hosting my website using my C web server
#69I like the string handling, especially #define LIT(S) ((string) {.data=(S), .size=sizeof(S)-1}) #define STR(S) ((string) {.data=(S), .size=strlen(S)})
Re: Show HN: Hosting my website using my C web server
#70This 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 Jetty out on the internet without one. This has never lead to any problems.
Infra or security people will see this and ask why I don't have an nginx instance in front of it. When I ask why I need one, the answers are all hand-wavy security or performance, lacking any specifics. The most specific answer I received once was slow loris, which hasn't been an issue for years.
Is reverse proxying something we've collectively decided to cargo cult, or is there some reason why it's a good idea that applies in the general case that I'm missing?