Author Topic: Programms I've made, starting with a tiny webserver.  (Read 1005 times)

I do a lot of programming outside of Blockland, in C++ and I've decided to share some things here, if I can.



The first of which is a little webserver, I just started it a few hours ago or so, so it's not complete, but features include:
---In the file "settings.syjc" you can set various preferences...
------Block certain files from being read.
------Block certain files with certain characters in them from being read. (e.g. a colon, so someone can't request files with an absolute file path)
------Set the hosting port.
------Set a secret page address that only you would know, that can be accessed on the website to instantly close the server.
------Set the maximum amount of connections accepted at one time.
------Set the packet size.
------Enable debug mode or not, displaying more messages and giving more information than usuall.
------Enable logging of all console messages, and choose the path of the file to store the logs.
---Full support for any html file by default.
---Handling of 404 errors properly.
---Handling of GET variables, variables are taken away from the page to get name, so if you type "bob.html?cat=true" it will still just get "bob.html".
---Easy for someone who knows C++ to take the source and add support for these variables into various pages, in place of a scripting langauge like PHP.

It's only about 1.3MB, and requires no installation or any files that don't come standard with windows. (I think)
And the soruce is given of course.

Source:
http://pastebin.com/JTFnSUbB
(about 400 lines long, and in C++ )
Execuatable:
http://www.filefront.com/17638484/Webserver.exe
Example configuration file:
(must be in the folder of the program, and named "settings.syjc")
Code: [Select]
*this is a comment line, anything that can't be handled is technically a comment line also
set port 80
set quitword dsnvlkjxcn
set packetsize 1024
set maxclients 50
*enable debug
perm private log.txt
perm private settings.syjc

Things being added next:
---Support for binary files, such as images.
---Intergrating some variables into pages.
---Allowing redirects.

Feel free to tell me what I should add/change on it.

Yes, I do relize this has been done many time before, and probably most of them are better than this one, this is just a topic about stuff I made, and I made this. I also am making/using this for my own purposes, so this isn't just to show off or to give away, before you complain about it.

This would have been better in off topic.
 :iceCream:

This would have been better in off topic.
 :iceCream:

I think that this is creative enough

Pretty good, despite me having, eheh, no full understanding of C++.