"Fossies" - the Fresh Open Source Software Archive

Member "opensips-3.0.1/modules/httpd/README" (1 Oct 2019, 7566 Bytes) of package /linux/misc/opensips-3.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "README": 3.0.0_vs_3.0.1.

    1 httpd Module
    2      __________________________________________________________
    3 
    4    Table of Contents
    5 
    6    1. Admin Guide
    7 
    8         1.1. Overview
    9         1.2. Dependencies
   10 
   11               1.2.1. OpenSIPS Modules
   12               1.2.2. External Libraries or Applications
   13 
   14         1.3. Exported Parameters
   15 
   16               1.3.1. ip(string)
   17               1.3.2. port(integer)
   18               1.3.3. buf_size (integer)
   19               1.3.4. post_buf_size (integer)
   20 
   21         1.4. Exported MI Functions
   22 
   23               1.4.1. httpd_list_root_path
   24 
   25         1.5. Exported Functions
   26         1.6. Known issues
   27 
   28    2. Developer Guide
   29 
   30         2.1. Available Functions
   31 
   32               2.1.1. register_httpdcb (module, root_path,
   33                       httpd_acces_handler_cb, httpd_flush_data_cb,
   34                       httpd_init_proc_cb)
   35 
   36    3. Contributors
   37 
   38         3.1. By Commit Statistics
   39         3.2. By Commit Activity
   40 
   41    4. Documentation
   42 
   43         4.1. Contributors
   44 
   45    List of Tables
   46 
   47    3.1. Top contributors by DevScore^(1), authored commits^(2) and
   48           lines added/removed^(3)
   49 
   50    3.2. Most recently active contributors^(1) to this module
   51 
   52    List of Examples
   53 
   54    1.1. Set ip parameter
   55    1.2. Set port parameter
   56    1.3. Set buf_size parameter
   57    1.4. Set post_buf_size parameter
   58 
   59 Chapter 1. Admin Guide
   60 
   61 1.1. Overview
   62 
   63    This module provides an HTTP transport layer for OpenSIPS.
   64 
   65    Implementation of httpd module's http server is based on
   66    libmicrohttpd library.
   67 
   68 1.2. Dependencies
   69 
   70 1.2.1. OpenSIPS Modules
   71 
   72    The following modules must be loaded before this module:
   73      * No dependencies on other OpenSIPS modules.
   74 
   75 1.2.2. External Libraries or Applications
   76 
   77    The following libraries or applications must be installed
   78    before running OpenSIPS with this module loaded:
   79      * libmicrohttpd.
   80 
   81 1.3. Exported Parameters
   82 
   83 1.3.1. ip(string)
   84 
   85    The IP address used by the HTTP server to listen for incoming
   86    requests.
   87 
   88    The default value is an empty string. If no IP address is set,
   89    then the http server will bind to all available IPs.
   90 
   91    Example 1.1. Set ip parameter
   92 ...
   93 modparam("httpd", "ip", "127.0.0.1")
   94 ...
   95 
   96 1.3.2. port(integer)
   97 
   98    The port number used by the HTTP server to listen for incoming
   99    requests.
  100 
  101    The default value is 8888. Ports lower than 1024 are not
  102    accepted.
  103 
  104    Example 1.2. Set port parameter
  105 ...
  106 modparam("httpd", "port", 8000)
  107 ...
  108 
  109 1.3.3. buf_size (integer)
  110 
  111    It specifies the maximum length (in bytes) of the buffer used
  112    to write in the html response.
  113 
  114    If the size of the buffer is set to zero, it will be
  115    automatically set to a quarter of the size of the pkg memory.
  116 
  117    The default value is 0.
  118 
  119    Example 1.3. Set buf_size parameter
  120 ...
  121 modparam("httpd", "buf_size", 524288)
  122 ...
  123 
  124 1.3.4. post_buf_size (integer)
  125 
  126    It specifies the length (in bytes) of the POST HTTP requests
  127    processing buffer. For large POST request, the default value
  128    might require to be increased.
  129 
  130    The default value is 1024. The minumal value is 256.
  131 
  132    Example 1.4. Set post_buf_size parameter
  133 ...
  134 modparam("httpd", "post_buf_size", 4096)
  135 ...
  136 
  137 1.4. Exported MI Functions
  138 
  139 1.4.1. httpd_list_root_path
  140 
  141    Lists all the registered http root paths into the httpd module.
  142    When a request comes in, if the root parth is in the list, the
  143    request will be sent to the module that register it.
  144 
  145    Name: httpd_list_root_path
  146 
  147    Parameters: none
  148 
  149    MI FIFO Command Format:
  150 opensips-cli -x mi httpd_list_root_path
  151 
  152 1.5. Exported Functions
  153 
  154    No function exported to be used from configuration file.
  155 
  156 1.6. Known issues
  157 
  158    Due to the fact that OpenSIPS is a multiprocess application,
  159    the microhttpd library is used in "external select" mode. This
  160    ensures that the library is not running in multithread mode and
  161    the library is entirely controled by OpenSIPS. Due to this
  162    particular mode of operations, for now, the entire http
  163    response is built in a pre-allocated buffer (see buf_size
  164    parameter).
  165 
  166    Future realeases of this module will address this issue.
  167 
  168    Running the http daemon as non root on ports below 1024 is
  169    forbidden by default in linux (kernel>=2.6.24). To allow the
  170    port binding, one can use setcap to give extra privilleges to
  171    opensips binary:
  172 setcap 'cap_net_bind_service=+ep' /usr/local/sbin/opensips
  173 
  174 Chapter 2. Developer Guide
  175 
  176 2.1. Available Functions
  177 
  178 2.1.1.  register_httpdcb (module, root_path, httpd_acces_handler_cb,
  179 httpd_flush_data_cb, httpd_init_proc_cb)
  180 
  181    Register a new http root with it's associated callbacks into
  182    the httpd module.
  183 
  184    Meaning of the parameters is as follows:
  185      * const char *mod - name of the module that register an http
  186        root path to be handled;
  187      * str *root_path - the registered root path;
  188      * httpd_acces_handler_cb f1 - handler to the callback method
  189        to be called on root path match;
  190      * httpd_flush_data_cb f2 - handler to the callback method to
  191        be called for sending extra data (at a later time);
  192      * httpd_init_proc_cb f3 - handler to the callback method to
  193        be called during httpd process init;
  194 
  195 Chapter 3. Contributors
  196 
  197 3.1. By Commit Statistics
  198 
  199    Table 3.1. Top contributors by DevScore^(1), authored
  200    commits^(2) and lines added/removed^(3)
  201      Name DevScore Commits Lines ++ Lines --
  202    1. Ovidiu Sas (@ovidiusas) 47 30 1667 147
  203    2. Razvan Crainea (@razvancrainea) 18 16 47 50
  204    3. Liviu Chircu (@liviuchircu) 11 9 26 49
  205    4. Bogdan-Andrei Iancu (@bogdan-iancu) 10 8 37 19
  206    5. Vlad Patrascu (@rvlad-patrascu) 10 7 52 89
  207    6. Ionut Ionita (@ionutrazvanionita) 8 6 65 21
  208    7. Stephane Alnet 3 1 39 3
  209    8. Stas Kobzar 3 1 2 2
  210    9. Dusan Klinec 3 1 1 1
  211    10. Peter Lemenkov (@lemenkov) 3 1 1 1
  212 
  213    (1) DevScore = author_commits + author_lines_added /
  214    (project_lines_added / project_commits) + author_lines_deleted
  215    / (project_lines_deleted / project_commits)
  216 
  217    (2) including any documentation-related commits, excluding
  218    merge commits. Regarding imported patches/code, we do our best
  219    to count the work on behalf of the proper owner, as per the
  220    "fix_authors" and "mod_renames" arrays in
  221    opensips/doc/build-contrib.sh. If you identify any
  222    patches/commits which do not get properly attributed to you,
  223    please submit a pull request which extends "fix_authors" and/or
  224    "mod_renames".
  225 
  226    (3) ignoring whitespace edits, renamed files and auto-generated
  227    files
  228 
  229 3.2. By Commit Activity
  230 
  231    Table 3.2. Most recently active contributors^(1) to this module
  232                       Name                   Commit Activity
  233    1.  Razvan Crainea (@razvancrainea)     Mar 2015 - Sep 2019
  234    2.  Liviu Chircu (@liviuchircu)         Mar 2014 - Jun 2019
  235    3.  Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2013 - Apr 2019
  236    4.  Vlad Patrascu (@rvlad-patrascu)     May 2017 - Apr 2019
  237    5.  Ovidiu Sas (@ovidiusas)             Jan 2012 - Jan 2019
  238    6.  Peter Lemenkov (@lemenkov)          Jun 2018 - Jun 2018
  239    7.  Ionut Ionita (@ionutrazvanionita)   Jan 2017 - Feb 2017
  240    8.  Dusan Klinec                        Dec 2015 - Dec 2015
  241    9.  Stas Kobzar                         Feb 2015 - Feb 2015
  242    10. Stephane Alnet                      Nov 2013 - Nov 2013
  243 
  244    (1) including any documentation-related commits, excluding
  245    merge commits
  246 
  247 Chapter 4. Documentation
  248 
  249 4.1. Contributors
  250 
  251    Last edited by: Razvan Crainea (@razvancrainea), Peter Lemenkov
  252    (@lemenkov), Liviu Chircu (@liviuchircu), Vlad Patrascu
  253    (@rvlad-patrascu), Ovidiu Sas (@ovidiusas), Bogdan-Andrei Iancu
  254    (@bogdan-iancu).
  255 
  256    Documentation Copyrights:
  257 
  258    Copyright © 2012-2013 VoIP Embedded, Inc.