Goals
µC/HTTPs /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 all available browser for computer system. 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.
Features
...
Multiple Instance
...
.
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 as , 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.Instance Working Directory | Each HTTP instance have his 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. | |||||
Multiple Connections | µC/ | HTTPs 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 | up to arround 18 connections on a web server, i.e. one connection per element in an | html HTML document such as images, | css CSS and | javascript files.Connection Hooks | µC/HTTPs 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/ | HTTPsHTTP-server. A hook is simply a defined function that allows the user to extend the functionality and alter the behavior of µC/ | HTTPsHTTP-server. Each instance can define unique hooks that µC/ | HTTPs HTTP-server calls. One such hook is called when receiving new request | (GET, POST or HEAD) where the request can ether be accepted or rejected or even the | html 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 | , CGI 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/ | HTTPs Statistic and Debug Variables | µC/HTTPs 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.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. | ||||
HTTP Header Fields | HTTP header fields are component of an HTTP transaction that provides information about request or response, or about connection parameters such as the content length of the body, the type of encoding, connection option, cookies, etc. µC/HTTPs can store received header fields from request. When the feature is enabled, for every field received a hook function is called to ask if the data must be stored or it can be dropped. Fields data is still stored until the connection is closed this allows the application access field data in any hooks function. HTTP header fields can be added to any response using a hook function where the upper application can add field to add transmitted via a simple API function. | ||||||
Method | µC/HTTPs is designed to support only GET, POST 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 a completed form. HTTP HEAD method is similar to GET method except that the body data of the response is not transmitted. this is useful for retrieving meta-information written in response header. | ||||||
HTML Form Submission | µC/HTTPs supports form submission using the HTTP POST method. When all the data is received a hook function is called to allow the upper application to use the key value data received. | ||||||
Dynamic Content / Token Replacement | µC/HTTPs allows dynamic content to be inserted in HTML web pages by using special tokens being substituted before the page is actually sent to the web browser. | ||||||
See section Secure Configuration. |
Features
µC/HTTP-server supports many features:
- Persistent Connection
- Form Processing
- Chunked Transfer Encoding for transmission
- HTTP Header Fields processing
- HTTP Query String processing
- Dynamic Content