Saturday, October 27, 2007

Hey look, a simple web server

I think I'm done writing my web server. I have gotten it to do what I want, namely this. This server will:
  1. Run just about anywhere. I sometimes run it off of a USB pen drive.
  2. Send all traffic over an HTTPS connection.
  3. Handle user authentication and permissions. You can only read and write where you have permissions.
  4. Allow you to store data in a remote location. Just POST to a URL to store something at that location, GET to retrieve it.
There really wasn't much to it. I was able to write this quickly and there wasn't that much code. The main thing it is lacking (in my opinion) is speed. This could be fixed by making it multithreaded and adding some caching since right now it always reads from the disk. Without further ado, here's the code. I also wrote a Python client and a JavaScript client to go with it will be coming soon. If you found this to be useful, please let me know.

I've also been looking at CherryPy as a framework to create the same type of portable, simple, and secure web server. As usual, stay tuned for details.

No comments: