ignite(block = TRUE, showcase = FALSE, ...)Begins the server,either blocking the console if block = TRUE or not. If showcase = TRUE a browser window is opened directing at the server address. ... will be redirected to the 'start' handler(s)
start(block = TRUE, showcase = FALSE, ...)A less dramatic synonym of for ignite
reignite(block = TRUE, showcase = FALSE, ...)As ignite but additionally triggers the 'resume' event after the 'start' event
resume(block = TRUE, showcase = FALSE, ...)Another less dramatic synonym, this time for reignite
extinguish()Stops a running server
stop()Boring synonym for extinguish
on(event, handler, pos = NULL)Add a handler function to to an event at the given position in the handler stack. Returns a string uniquely identifying the handler
off(handlerId)Remove the handler tied to the given id
trigger(event, ...)Triggers an event passing the additional arguments to the potential handlers
send(message, id)Sends a websocket message to the client with the given id, or to all connected clients if id is missing
attach(plugin, ...)Attaches a plugin to the server. A plugin is an R6 object with an onAttach method
header(name, value)Add a global header to the server that will be set on all responses
set_data(name, value)Adds data to the servers internal data store
get_data(name)Extracts data from the internal data store
remove_data(name)Removes the data with the given name from the internal data store
time(expr, then, after, loop = FALSE)Add a timed evaluation that will be evaluated after the given number of seconds, potentially repeating if loop=TRUE. After the expression has evaluated the 'then' function will get called with the result of the expression and the server object as arguments.
remove_time(id)Removes the timed evaluation identified by the id (returned when adding the evaulation)
delay(expr, then)As time except the expr is evaluated immediately at the end of the loop cycle
remove_delay(id)Removes the delayed evaluation identified by the id
async(expr, then)As delay and time except the expression is evaluated asynchronously. The progress of evaluation is checked at the end of each loop cycle
remove_async(id)Removes the async evaluation identified by the id. The evaluation is not necessarily stopped but the then function will not get called.
set_client_id_converter(converter)Sets the function that converts an HTTP request into a specific client id
test_request(request)Test the result of recieving a specific HTTP request
test_header(request)Test the result of recieving a specific HTTP header
test_message(request, binary, message, withClose = TRUE)Test the result of recieving a message over websocket and potentially closing the connection afterwards
test_websocket(request, message)Test the result of sending a message over websocket