sexta-feira, 3 de março de 2017

Bashttpd - Yes! an HTTP daemon written for bash!

Last week i received a request for a web page prototype for an embedded system that i'm working on. Not wanting to go through the painstaking procedure of compiling all artifacts for a full fledged HTTPd daemon such as Lighttpd server, and because it is a prototype, it will be run in a controlled environment... I decided to say: hey, perhaps i could do it in bash! Why not? I just have to parse the request directory/file, and serve the file to the user...

I've started developing, but then it hit me: Why do it before looking for it? I can't be the only one thinking about this. And i googled this: https://github.com/avleen/bashttpd

Behold 'The holy grail'!

I've started investigating the sources and decided to try it out. Turns out, it is quite impressive what it can do and the speed it does for 'development' environments. Sure i don't recommend this for production environments, but if you ever have to do a prototype and have limited resources, look no further: This is a powerful candidate!

Of course that 'With great power comes great responsibility': You can do a lot of powerful stuff with this, but beware: put it in an unsafe environment and a 'monster' will be unleashed! Hackers can do all kinds of nasty stuff with it :D

Here is my fork: https://github.com/rochajoel/bashttpd

Happy Coding!