WebServer
Interface to a web server instance.
** THIS IS AT EXPERIMENTAL STAGE. USE WITH CAUTION!! **
This class initializes a web server and returns its instance in a
WebServer
object. The web instance, once initiated by the class
constructor, it remains persistent during the Octave session and it is
gracefully terminated upon exit by the class destructor. The web instance is
still valid and active even if the variable holding the instance in Octave’s
workspace is deleted.
The class constructor (i.e. WebServer ()
) is private and cannot be
run directly. Use the static method WebServer.start ()
to initiate a
web server instance or reacquire its handle in case the variable has been
accidentally cleared from the workspace. Use the serve ()
public
method to update the contents being served by the web server instance.
Note that the class destructor (i.e. delete (obj)
) is public method.
** NEVER CALL DESTRUCTOR FOR AN OBJECT OF THIS CLASS MANUALLY !!! **
The WebServer
class utilizes the __webserve__
dynamically
linked library, which relies relies on the CrowCpp microframework.
** DO NOT use the __webserve__
function directly! **
Source Code: WebServer
serve
Update the WebServer’s content.
serve (obj, ctx)
updates the content being served by
the WebServer instance, obj. ctx can either be a
*Chart
object or a character vector containing any text/HTML
string.
See also: BarChart, BubbleChart, DoughnutChart, LineChart, PieChart, PolarAreaChart, RadarChart, ScatterChart, WebServer
start
Initialize a WebServer instance.
obj = WebServer.start ()
initializes a web server instance,
which by default listens to the localhost
on port 8080
and returns its handle to the WebServer
object, obj.
obj = WebServer.start (…, Name, Value)
initializes a WebServer instance with the settings specified by one or
more of the following Name, Value
pair arguments.
Name | Value | |
---|---|---|
port | A numeric integer value specifying the listening port of the web server instance. The default value is 8080. | |
bind-address | A character vector specifying the
bind-address of the web server instance. The default value is
"127.0.0.1" .
See also: WebServer |