Description Usage Arguments Details Value Author(s) See Also Examples
This utility function closure serves a static web page from a file, checking the file for changes and always serving the most recent copy.
1 |
fn |
The file path. |
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.
The function returned by this closure must return a valid HTTP response.
B. W. Lewis <blewis@illposed.net>
create_server
,
static_text_service
1 | # See the detailed example in help('websockets').
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.