![]() |
RA Flexible Software Package Documentation
Release v5.9.0
|
|
This module provides the lwIP HTTP Server integration documentation.
The LwIP HTTP Server library can be used to respond HTTP request. The documentation for the library can be found at the following link: lwIPServer.
The LwIP HTTP Server:
Configuration | Options | Default | Description |
---|---|---|---|
LwIP HTTPD CGI (old style) |
| Disabled | Enable CGI support (old style). Use this CGI type e.g. to execute specific actions and return a page that does not depend on the CGI parameters. |
LwIP HTTPD CGI SSI (new style) |
| Disabled | Enable CGI support with SSI feature (new style). Use this CGI handler if you want CGI information passed on to SSI. |
LwIP HTTPD SSI |
| Disabled | Enable SSI support (Server-Side-Includes). |
LwIP HTTPD SSI Raw |
| Disabled | Enable to implement an SSI tag handler callback that gets a const char* to the tag (instead of an index into a pre-registered array of known tags). |
LwIP HTTPD SSI By File Extension |
| Enabled | enable/disable or override the file SSI tag scan function. You need to provide an external function to perform the check: u8_t http_uri_is_ssi(struct fs_file *file, const char *uri) |
LwIP HTTPD SSI Extension | Manual Entry | ".shtml", ".shtm", ".ssi", ".xml", ".json" | List of file extensions handled as SSI files. Only used if LWIP_HTTPD_SSI_BY_FILE_EXTENSION != 0. |
LwIP HTTPD Support POST |
| Disabled | Set this to 1 to support HTTP POST. |
LwIP HTTPD Maximum CGI Parameters | Must be a non zero positive interger. | 16 | The maximum number of parameters that the CGI handler can be sent. |
LwIP HTTPD SSI Multipart |
| Disabled | SSI handler function is called with 2 more arguments to handle string too long to be inserted at once |
LwIP HTTPD Maximum Tag Name Length | Must be a non zero positive interger. | 8 | The maximum length of the string comprising the SSI tag name. The longer tags are ignored. |
LwIP HTTPD Maximum Tag Insert Length | Must be a non zero positive interger. | 192 | The maximum length of string that can be returned to replace any given tag. |
LwIP HTTPD POST Manual WND |
| Disabled | Enable configurating POST window response for HTTP server |
HTTPD Server Agent | Manual Entry | lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip) | This string is passed in the HTTP header as 'Server: HTTPD_SERVER_AGENT'. |
LwIP HTTPD Dynamic Headers |
| Disabled | Set this to 1 if you want to include code that creates HTTP headers at runtime. Else use static header created by the makefsdata tool. |
HTTPD Debug |
| Disabled | Configure debug for HTTPD file send timing |
HTTPD Use Mem Pool |
| Disabled | Set this to 1 to allocate http_state instead of using heap.If enabled, define MEMP_NUM_PARALLEL_HTTPD_CONNS (and MEMP_NUM_PARALLEL_HTTPD_SSI_CONNS for SSI) to set the size of the pool(s). |
HTTPD Server Port | Must be an interger in range 0-65535. | 80 | The http server port for HTTPD to use |
HTTPD Server Port HTTPS | Must be an interger in range 0-65535. | 443 | The https server port for HTTPD to use |
HTTPD Enable HTTPS |
| Disabled | Enable https support. |
HTTPD Maximum Retries | Must be a positive integer. | 4 | Maximum retries before the connection is aborted/closed. |
HTTPD Poll Interval | Must be a non zero positive interger. | 4 | How long the Server will keep the connection. The poll delay is X*500ms. |
HTTPD TCP Priority | Must be an interger in range 1-127. | 1 | Priority for tcp pcbs created by HTTPD 1 by default range from 1-127. |
LwIP HTTPD Timing |
| Disabled | Set this to 1 to enable timing each file sent. |
HTTPD Debug Timing |
| Disabled | Set this to 1 to enable timing each file sent. |
LwIP HTTPD Support Extstatus |
| Disabled | Set this to one to show error pages when parsing request fail. Else simply close the connection |
LwIP HTTPD Support V09 |
| Enabled | Set this to 0 to drop support for HTTP/0.9 clients (to save some bytes). |
LwIP HTTPD Support 11 Keepalive |
| Disabled | Set this to 1 to enable HTTP/1.1 persistent connections. |
LwIP HTTPD Support Requestlist |
| Enabled | Set this to 1 to support HTTP request coming in in multiple packets/pbufs. |
LwIP HTTPD Request Queuelen | Must be a non zero positive interger. | 5 | Number of rx pbufs to enqueue to parse an incoming request. |
LwIP HTTPD Request Bufsize | Must be a non zero positive interger. | LWIP_HTTPD_MAX_REQ_LENGTH | Number of (TCP payload-) bytes (in pbufs) to enqueue to parse and incoming request. |
LwIP HTTPD Maximum Request Length | Must be a non zero positive interger. | LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE)) | Defines the maximum length of a HTTP request line. |
LwIP HTTPD Maximum Request URI Length | Must be a positive interger. | 63 | This is the size of a static buffer used when URIs end with '/'. |
LwIP HTTPD POST Maximum Response URI Length | Must be a non zero positive interger. | 63 | Maximum length of the filename to send as response to a POST request. |
LwIP HTTPD SSI Include Tag |
| Enabled | Set this to 0 to not send the SSI tag. |
LwIP HTTPD Abort On Close Memory Error |
| Disabled | Set this to 1 to call tcp_abort when tcp_close fails with memory error. |
LwIP HTTPD Kill Old On Connections Exceeded |
| Disabled | Set this to 1 to kill the oldest connection. |
LwIP HTTPD Omit Header For Extensionless URI |
| Disabled | Set this to 1 to send URIs without extension without headers. |
HTTPD Limit Sending To 2mss |
| Enabled | By default, the httpd is limited to send 2*pcb->mss. |
HTTPD Maximum Write Length | The name function must be a valid C symbol | altcp_mss | Define this to a function that returns the maximum amount of data to enqueue. The function have this signature: u16_t fn(struct altcp_pcb* pcb);. |
LwIP HTTPD Custom Files |
| Disabled | Set this to 1 and provide the functions: - int fs_open_custom(struct fs_file *file, const char *name) Called first for every opened file to allow opening files that are not included in fsdata(_custom).c - void fs_close_custom(struct fs_file *file) Called to free resources allocated by fs_open_custom(). |
LwIP HTTPD Dynamic File Read |
| Disabled | Set this to 1 to support fs_read(). Else only one-block files are supported, and the contents must be ready after fs_open(). |
LwIP HTTPD File State |
| Disabled | Set this to 1 to include an application stateargument per file that is opened. |
LwIP HTTPD File Extension |
| Disabled | Set this to 1 to add the pextension field to the fs_file structure.New code should use LWIP_HTTPD_FILE_STATE instead. |
HTTPD Precalculated Checksum |
| Disabled | Support asynchronous read operations. |
LwIP HTTPD FS Async Read |
| Disabled | Set this to 1 to add the pextension field. |
HTTPD Fsdata File | Manual Entry | fsdata_sample.c | Provide source name file of FS custom data. This data file will be included by fs.c file |
HTTP Is Data Volatile |
| Allow Copy | Determines if HTTP data should be copied into the TCP buffer before transmission. Allow Copy: data will be copied into memory belonging to the stack. Allow Copy and More: Notify to TCP that data will be copied into memory belonging to the stack and additional data will follow in subsequent TCP transmissions. |
LwIP HTTPD Use Default Template |
| Enabled FSdata Generator | Set this to 1 to when intent to use the default template from the generator |
There are two ways to use fsdata file as follows:
When the stack "LwIP HTTP Server" is added, by default it includes the stack "LwIP HTTP Server FS" which is the sample file provided in the LwIP HTTP Server library repository, and the fsdata_sample.c file is generated at the src/fsdata/ path.
In case, creating a new fsdata.c file by makefsdata script, follow these detailed steps:
This is a basic example of minimal use of the LwIP HTTP Server APIs in an application.