ambiorix
ambiorix copied to clipboard
error when trying to use custom websocket handler function
When trying to specify my own websocket handler function:
app$websocket <- \(ws){
ws$onMessage(\(binary, message){
cat("Received a message:", message, "\n")
})
}
I get the following error:
Error in app$websocket <- function(ws) { :
cannot add bindings to a locked environment
I am following the documentation here:
https://ambiorix.dev/docs/ambiorix/websocket#bypass-ambiorix
I think this "websocket" field needs to be defined in the app or router, but I am not sure as I am not very familiar with websockets. Sorry if I am missing something obvious here.