library(httpuv) app <- list( call = function(req) { wsUrl = paste(sep='', '"', "ws://", ifelse(is.null(req$HTTP_HOST), req$SERVER_NAME, req$HTTP_HOST), '"') list( status = 200L, headers = list( 'Content-Type' = 'text/html' ), body = paste( sep = "\r\n", "", "", "", '', "", "", "", '

Send Message

', '
', '', '

Received

', '
', '', "", "" ) ) }, onWSOpen = function(ws) { ws$onMessage(function(binary, message) { ws$send(message) }) } ) browseURL("http://localhost:9454/") runServer("0.0.0.0", 9454, app, 250)