Not to compare but i realice this is something you can do with rust with few lines https://github.com/actix/actix-web/tree/master/actix-http
Show HN: Hosting my website using my C web server
141–150 of 160 posts
Re: Show HN: Hosting my website using my C web server
#142> 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 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 p…
> slow loris, Really? I am curious. You are not talking of monkeys?
Re: Show HN: Hosting my website using my C web server
#143Earlier quoted context omitted.
What are you on about? C is more useful day-to-day than the vast majority of languages. Learning it is hardly a waste of time.
C is one of the worst designed programming languages still in use. It's a ridiculous, cruel joke on anyone looking to learn unless your actual goal is to learn what a programming language designed 70s computers looks like.
Re: Show HN: Hosting my website using my C web server
#144Earlier quoted context omitted.
Not the only time it’s been brought up in this thread: https://news.ycombinator.com/item?id=41643198 I’m waiting for someone to chime in and explain why that would be a bad idea cause I can’t think of it from a security perspective.
Once at a certain level of complexity, e.g. having several hundred/thousand resources, then you start automating your hardcoded paths, and then you still can get bitten. vs just putting things in a subfolder of your repo or whatever and having the default handling not accept `..` path components
Re: Show HN: Hosting my website using my C web server
#145Earlier quoted context omitted.
Not the only time it’s been brought up in this thread: https://news.ycombinator.com/item?id=41643198 I’m waiting for someone to chime in and explain why that would be a bad idea cause I can’t think of it from a security perspective.
From a security perspective a lot of changes to this world would be an upgrade. However implementing security features is always a trade off, and sometimes good security is just not worth the loss of other things.
For example, you implement a super secure solution and no one hacks your website, but you end up being very unproductive and can't find a job. You lost food security.
In covid, bank systems in my country were so hard to use, there were like 6 passwords to login. Not only was usability compromised in the sense of security, but people, especially old people, started lining up in banks, compromising health security.
To say nothing of the scenarios were users just bypass obnoxious exaggerated security systems, like leaving a post-it note with a password on their screens.
Re: Show HN: Hosting my website using my C web server
#146How 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.
does that mean recompile every time them HTML is changed? No thanks :)
Although if you start caching contents in memory (which is faster) you would have to at least kill the server and restart it. Or signal a reload.
Re: Show HN: Hosting my website using my C web server
#147> 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 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 p…
For me, Reverse proxy helps me keep my origin server only for 1 purpose: Serve the Application. Everything else, I can handle with Reverse Proxy including TLS Termination, load balancing, URL rewrites, Security (WAF etc) if needed. Separation of duties for me. Overall, the benefit is that you can keep your origin server protected and only serve relevant traffic. Also, lets say you offer custom domain to your own cust…
Similarly if you start load balancing, you can put some server in the middle yes. But the ideal solution is at the DNS level I think, unless there's some serious compute going on (which a website loading a page from disk is not).
URL rewrites should not be a thing unless you have a clusterfuck, and Security is best accomplished in my experience by removing, rather than by adding.
Re: Show HN: Hosting my website using my C web server
#148Earlier quoted context omitted.
For me, Reverse proxy helps me keep my origin server only for 1 purpose: Serve the Application. Everything else, I can handle with Reverse Proxy including TLS Termination, load balancing, URL rewrites, Security (WAF etc) if needed. Separation of duties for me. Overall, the benefit is that you can keep your origin server protected and only serve relevant traffic. Also, lets say you offer custom domain to your own cust…
TLS should be done with proxies, yes. The Stunnel approach is Gospel. Similarly if you start load balancing, you can put some server in the middle yes. But the ideal solution is at the DNS level I think, unless there's some serious compute going on (which a website loading a page from disk is not). URL rewrites should not be a thing unless you have a clusterfuck, and Security is best accomplished in my experience by…
So Ingress -TLS-> Container (pod).
We implemented LinkerD for this, which runs as a sidecar in the pod. Since the sidecar and the main container communicate on the same machine, this is OK.
Re: Show HN: Hosting my website using my C web server
#149Earlier quoted context omitted.
this looks much more practical than my own small and lightweight http/1.0 webserver, but i'm guessing that rws is not nearly as small and lightweight: http://canonical.org/~kragen/sw/dev3/server.s http://canonical.org/~kragen/sw/dev3/httpdito-readme the really surprising thing about that was that when your memory map only has five 4k pages in it, linux gets really fast at forking
httpdito looks incredible
Re: Show HN: Hosting my website using my C web server
#150Earlier quoted context omitted.
It’s kind of sad how C has gotten the reputation as this dangerous and scary dark art that only wizards can successfully wield. C was my first love, it’s what we used throughout university, it’s what our operating systems and basic tools are all written in... If you go to your favorite language and step down into the actual implementation of, for example, your network calls, you’re eventually going to get to poll() a…
But if the dy/dx gradient is that experts can develop faster in safe languages, and novices make fewer mistakes in safe languages, then C isn't useful day-to-day. It occupies an ever-shrinking ecological niche on the Pareto frontier.