HttpDaemon {R.rsp} | R Documentation |
Package: R.rsp
Class HttpDaemon
Object
~~|
~~+--
HttpDaemon
Directly known subclasses:
public static class HttpDaemon
extends Object
A minimalistic HTTP daemon (web server) that preprocesses R Server Pages.
HttpDaemon(...)
... |
Not used. |
The actual server is written in Tcl such that it runs in a non-blocking mode, which means that the R prompt will be available for other things. This class is tightly coupled with the source code of the Tcl script.
The Tcl server was written by Steve Uhlers, and later adopted for R by Philippe Grosjean and Tom Short (Rpad package author) [1].
Methods:
appendRootPaths | Appends and inserts new paths to the list of known root directories. | |
as.character | Returns a short string describing the HTTP daemon. | |
finalize | - | |
getConfig | Retrieves the servers 'config' structure from Tcl. | |
getCount | - | |
getDefaultFilename | Gets the default filename to be loaded by the HTTP daemon. | |
getHttpRequest | Gets the HTTP request. | |
getPort | Gets the socket port of the HTTP daemon. | |
getRootPaths | Gets the root directories of the HTTP daemon. | |
insertRootPaths | - | |
isStarted | Checks if the HTTP daemon is started. | |
openUrl | Starts the HTTP daemon and launches the specified URL. | |
processRsp | Processes an RSP page. | |
restart | Restarts the HTTP daemon. | |
setCount | - | |
setRootPaths | Sets a new set of root directories for the HTTP daemon. | |
sourceTcl | Loads the Tcl source for the HTTP daemon into R. | |
start | Starts the HTTP daemon. | |
startHelp | Starts the HTTP daemon and launches the help page. | |
stop | Stops the HTTP daemon. | |
writeResponse | Writes a string to the HTTP output connection. |
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clone, detach, equals, extend, finalize, gc, getEnvironment, getFields, getInstanciationTime, getStaticInstance, hasField, hashCode, ll, load, objectSize, print, save
Henrik Bengtsson (http://www.braju.com/R/)
[1] Rpad package, Tom Short, 2005.
if (interactive()) { if (!HttpDaemon$isStarted()) { # Start the web server rootPath <- system.file("rsp", package="R.rsp") HttpDaemon$start(rootPath=rootPath, port=8074, default="index.rsp") } browseURL("http://127.0.0.1:8074/") }