websocket
WebSocket client for R
The websocket package is an R WebSocket client library backed by the websocketpp C++ library that handles WebSocket I/O on a separate thread from R. It provides a client for establishing WebSocket connections, sending and receiving messages, and managing connection lifecycle events.
The package uses an event-driven callback system (onOpen, onMessage, onClose, onError) that makes it straightforward to handle asynchronous WebSocket communication in R. It supports both text and binary messages, can be used within Shiny applications, and works with WebSocket servers to implement patterns like proxies for logging or modifying traffic. The threaded I/O design prevents WebSocket operations from blocking R’s main execution thread.





