static_text_service: Serve a static web page from a file.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/websockets.R

Description

This utility function closure serves a static web page from a character string.

Usage

1

Arguments

text

The HTML web page as a character string.

Details

A function of two arguments, socket and header is returned. The socket argument indicates the low-level socket descriptor of the websocket client. The header argument contains a parsed HTTP GET request. When invoked, the function may examine the GET request and respond accordingly, usually with a valid HTTP 200 response, or a 40* response indicating an error.

Value

The function returned by this closure must return a valid HTTP response.

Author(s)

B. W. Lewis <blewis@illposed.net>

See Also

create_server, static_file_service

Examples

1
# See the detailed example in help('websockets').

rstudio/R-Websockets documentation built on May 28, 2019, 4:33 a.m.