HTTPD module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”This module provides an HTTP transport layer for OpenSIPS.
Implementation of httpd module’s http server is based on libmicrohttpd library.
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- No dependencies on other OpenSIPS modules.
External Libraries or Applications
Section titled “External Libraries or Applications”The following libraries or applications must be installed before running OpenSIPS with this module loaded:
- libmicrohttpd.
Exported Parameters
Section titled “Exported Parameters”ip(string)
Section titled “ip(string)”The IP address used by the HTTP server to listen for incoming requests.
The default value is an empty string. If no IP address is set, then the http server will bind to all available IPs.
...modparam("httpd", "ip", "127.0.0.1")...port(integer)
Section titled “port(integer)”The port number used by the HTTP server to listen for incoming requests.
The default value is 8888. Ports lower than 1024 are not accepted.
...modparam("httpd", "port", 8000)...buf_size (integer)
Section titled “buf_size (integer)”It specifies the maximum length (in bytes) of the buffer used to write in the html response.
If the size of the buffer is set to zero, it will be automatically set to a quarter of the size of the pkg memory.
The default value is 0.
...modparam("httpd", "buf_size", 524288)...post_buf_size (integer)
Section titled “post_buf_size (integer)”It specifies the length (in bytes) of the POST HTTP requests processing buffer. For large POST request, the default value might require to be increased.
The default value is 1024. The minumal value is 256.
...modparam("httpd", "post_buf_size", 4096)...Exported MI Functions
Section titled “Exported MI Functions”httpd_list_root_path
Section titled “httpd_list_root_path”Lists all the registered http root paths into the httpd module. When a request comes in, if the root parth is in the list, the request will be sent to the module that register it.
Name: httpd_list_root_path
Parameters: none
MI FIFO Command Format:
:httpd_list_root_path:_reply_fifo_file__empty_line_Exported Functions
Section titled “Exported Functions”No function exported to be used from configuration file.
Known Issues
Section titled “Known Issues”Due to the fact that OpenSIPS is a multiprocess application, the microhttpd library is used in “external select” mode. This ensures that the library is not running in multithread mode and the library is entirely controled by OpenSIPS. Due to this particular mode of operations, for now, the entire http response is built in a pre-allocated buffer (see buf_size parameter).
Future realeases of this module will address this issue.
Running the http daemon as non root on ports below 1024 is forbidden by default in linux (kernel>=2.6.24). To allow the port binding, one can use setcap to give extra privilleges to opensips binary:
setcap 'cap_net_bind_service=+ep' /usr/local/sbin/opensipsDeveloper Guide
Section titled “Developer Guide”Available Functions
Section titled “Available Functions”register_httpdcb (module, root_path, httpd_acces_handler_cb, httpd_flush_data_cb, httpd_init_proc_cb)
Section titled “register_httpdcb (module, root_path, httpd_acces_handler_cb, httpd_flush_data_cb, httpd_init_proc_cb)”Register a new http root with it’s associated callbacks into the httpd module.
Meaning of the parameters is as follows:
- *const char mod - name of the module that register an http root path to be handled;
- *str root_path - the registered root path;
- httpd_acces_handler_cb f1 - handler to the callback method to be called on root path match;
- httpd_flush_data_cb f2 - handler to the callback method to be called for sending extra data (at a later time);
- httpd_init_proc_cb f3 - handler to the callback method to be called during httpd process init;
Contributors
Section titled “Contributors”By Commit Statistics
Section titled “By Commit Statistics”Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
| # | Name | DevScore | Commits | Lines++ | Lines— |
|---|---|---|---|---|---|
| 1. | Ovidiu Sas (@ovidiusas) | 42 | 24 | 1677 | 171 |
| 2. | Stefan Darius (@dariusstefan) | 7 | 4 | 238 | 28 |
| 3. | Bogdan-Andrei Iancu (@bogdan-iancu) | 4 | 2 | 2 | 2 |
| 4. | Razvan Crainea (@razvancrainea) | 3 | 1 | 2 | 2 |
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits
(3) ignoring whitespace edits, renamed files and auto-generated files
By Commit Activity
Section titled “By Commit Activity”| # | Name | Commit Activity |
|---|---|---|
| 1. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | Jun 2026 - Jun 2026 |
| 3. | Bogdan-Andrei Iancu (@bogdan-iancu) | Jan 2013 - Jan 2014 |
| 4. | Ovidiu Sas (@ovidiusas) | Jan 2012 - Mar 2013 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Ovidiu Sas (@ovidiusas), Bogdan-Andrei Iancu (@bogdan-iancu).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0