Nothing
# Connect to this using websockets on port 9454
# Client sends to server in the format of {"data":[1,2,3]}
# The websocket server returns the standard deviation of the sent array
library(jsonlite)
library(httpuv)
# Server
app <- list(
onWSOpen = function(ws) {
ws$onMessage(function(binary, message) {
# Decodes message from client
message <- fromJSON(message)
# Sends message to client
ws$send(
# JSON encode the message
toJSON(
# Returns standard deviation for message
sd(message$data)
)
)
})
}
)
runServer("0.0.0.0", 9454, app, 250)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.