如何在Shiny上禁用websocket? [英] How to disable websocket on Shiny?

查看:74
本文介绍了如何在Shiny上禁用websocket?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Microsoft Azure WebApp托管的Docker容器中有一个Shiny应用程序.激活使用Azure Active Directory登录后,该应用程序将无法再使用.

I have a Shiny application in a Docker container hosted on Microsoft Azure WebApp. The application doesn't work anymore when log in with Azure Active Directory is activated.

可以访问应用程序页面,但在 Firefox网络跟踪.如果未使用AAD登录,则不会出现此错误.

The application page is accessible but a error 500 is returned on websocket content as shown on the Firefox network trace. This error is not present without log in with AAD.

我尝试将以下选项添加到/etc/shiny-server/shiny-server.conf :

I've tried adding the following options to /etc/shiny-server/shiny-server.conf:

sanitize_errors off;
disable_protocols websocket xdr-polling;

这没有解决问题,网络跟踪未更改.如何强制Shiny不要使用websocket?

This did not solve the issue, the network trace are unchanged. How can I force Shiny not to use websocket?

推荐答案

使用新版本的Azure App Services解决了此问题.我下面的解决方案不再需要了!

With the new version of Azure App Services this problem was solved. My solution below is NOT needed any more!

还建议升级到最新的Shiny及其基础的httpuv库(> = 1.5.2),以解决一些相关问题(请参见

Upgrading to the latest Shiny and its underlying httpuv library (>= 1.5.2) is also recommended which solves some related problems (see https://community.rstudio.com/t/shiny-v1-3-known-regressions-and-serious-issues/28180).

在我不得不解决这里描述的问题之前,

Before I had to solve the problem described here How do I get Shiny-server to working with Azure Active Directory

原始答案(现已解决,因为解决了Azure App Services的问题)

Original answer (now deprecated for resolving the issue with Azure App Services):

我在Shiny上遇到了同样的问题:启用Azure Active Directory(AD)身份验证后,浏览器无法加载Websocket内容.该websocket调用获得了HTTP 101(交换协议").但是它在禁用AD身份验证时可以正常工作,因此似乎问题源是进行身份验证的Azure代理(例如,它插入了一些HTTP标头).我通过Shiny服务器配置中的 disable_protocols websocket xdr-polling; 解决了该问题.

I had the same problem with Shiny: The browser can't load Websocket content when Azure Active Directory (AD) Authentication is enabled. The websocket call got HTTP 101 ("Switching protocols"). But its working when AD Authentication is disabled, so seems like the problem source is the Azure Proxy doing the authentication (e.g. it inserts some HTTP headers). I solved the problem via disable_protocols websocket xdr-polling; in the Shiny server config.

这篇关于如何在Shiny上禁用websocket?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆