Are websockets used in shiny

Hi all,

In shiny architecture (client and server model), are web-sockets requests used? Or is it only http request that is sent to server?

I know this is very direct question, but wanted to understand the back end working of shiny?

Yes, websockets are a essential building block of shiny. Please check the following:

Thanks,

However While researching in google, I just got this.
I know google may not give right suggestions all the time. But just wanted to double check

That sentence is out of context. The curly brackets indicate that the author is referring to the R package library(websocket) (not websockets in general):

In practice, Shiny does not use {websocket} . As mentioned earlier, the client is directly built from JS. To better understand the whole process, we are going to design a simple web page containing an HTML range slider, pass its value from JS to R through the websocket, so that R can produce a simple histogram.

Here is the source.

Maybe you have trust in code, please see:

shiny imports and uses library(httpuv) which is described as follows:

httpuv provides low-level socket and protocol support for handling HTTP and WebSocket requests directly from within R. It uses a multithreaded architecture, where I/O is handled on one thread, and the R callbacks are handled on another.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.