rstudio / shiny-server

Host Shiny applications over the web.
https://rstudio.com/shiny/server
Other
716 stars 289 forks source link

Use SockJS 1.5.0 #496

Closed jcheng5 closed 3 years ago

jcheng5 commented 3 years ago

This upgrades our SockJS client from a copy-and-pasted copy of SockJS 0.3.4, to a proper Node dependency version of v1.5.0. Among other benefits, I'll know when new versions of the sockjs-client are released, and any security vulnerabilities will be flagged.

The user-visible changes are limited to support for the new transports eventsource and htmlfile, which were introduced into the UI by shiny-server-client 1.2.0 but not actually supported by Shiny Server until now AFAIK. The new protocols will automatically be disabled if the older protocols iframe-eventsource and iframe-htmlfile, respectively, are disabled (by disable_protocols). This is to prevent breaking existing installations of Shiny Server that disable "everything but X".

Also, note that htmlfile doesn't work unless the Shiny app contains the line <script>document.domain = document.domain;</script>. I don't fully understand this but it seems to be a bad idea, maybe just pretend that protocol doesn't exist.

Testing notes

schloerke commented 3 years ago

document.domain = document.domain will prolly have to be visited in the future when compatibility support is removed. Hopefully we catch/fix it first before everyone gets hosed.

https://developer.mozilla.org/en-US/docs/Web/API/Document/domain

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

MadhulikaTanuboddi commented 3 years ago

connected to https://github.com/rstudio/shiny-server-pro/issues/852