About HTTP-server

Goals

µC/HTTP-server can be used in the more traditional way, meaning used to store web pages and web resources that can be fetched through Web Browsers. In that optic, µC/HTTP-server is compliant with all the available browsers (Firefox, Chrome, Safari, etc.) for computer system.

µC/HTTP-server can also be used in a more web service style, i.e., to fetch, modify and create web resources that are not necessarily files.

It was written for target systems running µC/TCP-IP and an OS such as µC/OS-II or µC/OS-III.

Design

Scalable

Can contain only required features to minimize the memory footprint.

See section Module Configuration.

Add-on

Add-on modules are also given to enhance and simplify the development of your HTTP server application.

See section Add-on.

File System

Support any File System or can be used via a "Static File System" which is provided inside the µC/HTTP-server source code.

The server can also be used without any File System.

See sections File System Configuration and Interface with File System.

Multiple Instances

µC/HTTP-server supports multiple instances, i.e., it’s possible to launch many web server on different TCP port. This allow, for example, to have a part of a web application without security and another part with SSL/TLS security. Note that each web server instance have a dedicated task which run the same code.

It’s also possible to start and stop an web server instance anytime at run time after the instance has been initialized.

Multiple Connections

µC/HTTP-server has been designed to handle multiple connections simultaneously. All active connections are processed in parallel using only one task. Note that most web browsers can open arround 18 connections on a web server, i.e. one connection per element in an HTML document such as images, CSS and Javascript files.

Supports up to 255 client connections.

Methods

µC/HTTP-server core is designed to support only GET, POST, PUT, DELETE and HEAD HTTP methods.

HTTP GET method is designed to retrieve information from the server such as a HTML document, image, Javascript file, etc.

HTTP POST method is used to request that a web server accepts the data in the request for storage. It is the most common method used when uploading a file or submitting an HTML form.

HTTP PUT method is usually used to update an already existing resource with new data supplied in the request.

HTTP DELETE method is used to remove a resource from the server.

HTTP HEAD method is similar to the GET method except that the body data of the response is not transmitted. this is useful for retrieving meta-information written in response header.

Hook Functions

µC/HTTP-server allows application programmer to define “hook” functions, which are called by µC/HTTP-server. A hook is simply a defined function that allows the user to extend the functionality and alter the behavior of µC/HTTP-server. Each instance can define unique hooks that µC/HTTP-server calls.

One such hook is called when receiving new request where the request can ether be accepted or rejected or even the HTML document to be returned can be changed. Another hook is called when an error occurs during the processing of a request and yet another when the request processing is completed. Some other hooks are called to get the error page to return, header field and dynamic content. Note that all hook function defined by the upper application must be non-blocking an relatively fast .

See sections Hook Configuration and Hook Functions.

Statistic and Debug Variables

µC/HTTP-server have many built-in statistic and error counters that can be used for debugging or for logging usage statistic. Statistic and/or error counter can be easily disabled.

See section Argument Checking and Debug Configuration.

Instance Working Directory

When a File System is present and used, each HTTP server instance have its own working directory where all folders and files that can be accessed must be located. For security it’s not possible to a web server to access folders and files located outside his working directory.

HTTPs - Secure Web Server

Hypertext Transfer Protocol Secure (HTTPS) is the combination of HTTP with an encryption layer like SSL or TLS. It provides bidirectional encryption of communication between a client and server. µC/HTTP-server can be configured to be secure if µC/TCPIP secure port and third parties security product is present in the project. Only a simple configuration is required to specify the server certificate and key.

SSL/TLS certificate and key can be obtained from a Certificate authority or by generating a self signed certificate using a common secure tool such as OpenSSL.

See section Secure Configuration.

Features

µC/HTTP-server supports many features: