The Beesnest HTTP Server.
The Beesnest HTTP Server is part of the Beesnest system. The HTTP server follows
fully the HTTP 1.1 protocol, and this is a multithread multi-host server.
The server has a built in login system as well.
What you get using Beesnest as an HTTP Server
- The server is small (less then 800Kb).
- It is a multi-threaded server.
- It is a multi-host server.
- It is very simple to configure.
- It has a built in login system.
- It can support almost any scripting language.
- It is impossible to hack (I hope...).
- It protects itself from DoS attack.
- And its a free software.
What you wont get...
- The server does not support CGI calls.
- The server does not yet have SSL.
- For now I have just a Windows version (service).
This server can support more then one host. You set the hosts list in the
configuration file. There always has to be a host named Default-Host
this is the main host and the host a HTTP 1.0 requests will be directed to. The
other hosts can be named as you wish. Each host has a list of aliases names
(or IP address) in the configuration file. In addition each host has a
, and default file name
. The path name to the root
folder can be absolute or relative. In this folder you will put your files to
publish (you can use sub-folder obviously).
The server returns only files under the host root, and just files from one of
the types you defined for this host in the configuration file. Each type of file
you want the host to return has to have an entry in the configuration file under
entry. The name of the entry will be the name of the
extension of the file to handle (in lower case letters). Under this entry you
should specify the Contact-Type
of the file, as you want the browser to
receive it. The server will return the file just if in the Accept
it will find the Client-Type
type, or more general type. In addition you
have to write the list of hosts that will be permitted to return this file type.
You can write all
if all the hosts allowed returning this file type.
Look at the configuration file
This server supports just one resource for a URL. So it does not check the
headers. The server does not
encode the response in any way, so it does not check the Accept-Encoding
header. And it does not support ranges (for now at least), so it does not check
header. The server does check the Accept header
This server creates a log. You can set the log file to rotate every day, week,
month or never. You can set the format of an entry in this log file. Do it in
the configuration file. You can also set the server to write some general
messages by setting the Log-Level
to more than 2. Note that this will
slow down the server, practically under high load. If you don't want the
general messages, just keep the log level at 2, in the configuration file.
This server stores the last files it returned in it's memory. If a new request
for one of these files will arrive, and the file has not been changed, the
server will not access the file system again, and return the file from it's
memory. The number of files to store is set in the configuration file. When the
server exceeds this number, it erases the last accessed file.
The server has a system to control the load of requests it will replay to.
You can set the maximum total number of requests (threads) that will be handled
simultaneously. As well as the maximum number of request from one client (one IP
address) that will be handled simultaneously. see the
I set my server to handle 20 total threads and just five from one client.
So the computer will be protected from Denial of Service attack. Further more
one client will not be able to overload the server, but a group of 4 clients
will be able to jam the server in an organized attack
(then the Beesnest just go to sleep, so it will not block the entire computer).
Server Side Includes:
Beesnest support the server side instructions: include
. They all come in an instruction that looks like:
<!--# command name = value ... -->
In all instructions you can use double quotes, single quotes or no quotes.
Beesnest executes SSI instructions before it executes any scripts, in all the files
that set to type text/html
- include is the most common instruction, it support file or
virtual. You cannot enter an infinite includes loop.
<!--# include [file|virtual] = "path" -->
- echo prints the value of a request variable. Note that Beesnest sets
some "request" variables, for the user use. They all start with BN_.
<!--# echo var = 'name' -->
- set is used to set a request variable. set can also set the
response size and time limits. use BNI_SizeLimit and BNI_TimeLimit.
<!--# set var = name value = new-value -->
note that the order of var-value is important
about the combination of SSI and scripts: It is not
existing! You cannot combine SSI instructions in a script. Beesnest doesn't
check for it, but it will not work. In any script you should have functions to
get and set request variables. If you need an access to a file, you need to do
it with your script, you cannot use #include. Never write an SSI instruction
inside the bnscript
Here is an example of how to use SSI