Table of Contents
List of Examples
Table of Contents
This module provides an HTTP transport layer implementation for the RPC management interface in a human-readable format.
The xHTTP_RPC module uses the xHTTP module to handle HTTP requests. Read the documentation of the xHTTP module for more details.
This module does not implement asynchronous RPC commands. It is unlikely that asynchronous RPC commands will be executed from an RPC web interface.
This module does not accept parameters embedded in a structure (see RPC documentation for more info about how parameters can be passed to RPC).
At startup, all RPC commands are sorted and grouped based on their format. The expected format is [group].[subcommand]. The initial xhttp_rpc webpage displays all the retrieved groups. All RPC commands are available as sub-menus of each [group]. If an RPC command is not in the expected format, it will be dropped from the initial xhttp_rpc home page menu.
Specifies the root path for RPC http requests. The link to the RPC web interface must be constructed using the following pattern: http://[server_IP]:[tcp_port]/[xhttp_rpc_root]
Default value is "rpc".
Example 1.1. Set xhttp_rpc_root
parameter
... modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc") ...
Specifies the maximum length of the buffer (in bytes) used to write the RPC reply information in order to build the HTML response.
Default value is 0 (auto set to 1/3 of the size of the configured pkg mem).
Handle the HTTP request and generate a response.
Example 1.3. dispatch_xhttp_rpc
usage
... tcp_accept_no_cl=yes ... loadmodule "sl.so" loadmodule "xhttp.so" loadmodule "xhttp_rpc.so" ... modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc") ... event_route[xhttp:request] { $var(xhttp_rpc_root) = $(hu{s.substr,0,9}); if ($var(xhttp_rpc_root) == "/http_rpc") dispatch_xhttp_rpc(); else xhttp_reply("200", "OK", "text/html", "<html><body>Wrong URL $hu</body></html>"); } ...