You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

将Shiny-proxy嵌入iframe:配置CSP仍无法解决Chrome拦截问题

问题:Shiny Proxy应用嵌入Hub应用遭Chrome拦截

我需要将通过Shiny-proxy运行的Shiny应用嵌入到另一个Hub应用中,在shiny-proxy的application.yml中做了如下配置:

frame-options: allow-from http://127.0.0.1:5501
  Content-Security-Policy: frame-ancestors 'self' http://127.0.0.1:5501

由于allow-from指令已在Chrome和Safari中废弃,我按照建议改用Content-Security-Policy的frame-ancestors配置,但问题依然存在,Chrome仍会拦截嵌入操作。完整的application.yml配置如下:

proxy:
  default-webSocket-reconnection-mode: Auto
  same-site-cookie: None
#  stop-proxies-on-shutdown: false
#  recover-running-proxies: true
#  recover-running-proxies-from-different-config: true
  title: Open Analytics Shiny Proxy
  logo-url: https://www.openanalytics.eu/shinyproxy/logo.png
  landing-page: /
  heartbeat-rate: 10000
  heartbeat-timeout: -1
  heartbeat-enabled: false
  container-wait-time: 20000
  servlet.session.timeout: 100000
  container-log-path: /var/log/shinyproxy/container-logs
  port: 8080
  authentication: simple
  admin-groups: admin
  users:
  - name: frank
    password: password
    groups: scientists
  # Docker configuration
  #  container-backend: docker
  container-backend: docker
  docker:
    cert-path: /home/none
    url: http://127.0.0.1:2375
    port-range-start: 20000

  specs:
  - id: something
  ...
logging:
  file:
    name: /var/log/shinyproxy/shinyproxy.log
#  level:
#    root: DEBUG
server:
  frame-options: allow-from http://127.0.0.1:5501
  Content-Security-Policy: frame-ancestors 'self' http://127.0.0.1:5501
  secure-cookies: true

错误截图

内容的提问来源于stack exchange,提问作者Mush-A

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.07 16:35:14