r - R 闪亮 iframe 未连接到 HTTPS Flask 应用程序
问题描述
我正在尝试flask
在R shiny iframe
.
对于普通的 http 协议,这可以正常工作。但是,一旦我将其更改为 https 协议,它就无法连接,尽管我可以在浏览器中毫无问题地显示 https 烧瓶应用程序。在 iframe 中显示公共 https 网站也不是问题
我的烧瓶代码:
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/data", methods=['GET', 'POST'])
def home():
return render_template('index.html')
if __name__ == "__main__":
app.run(debug=True, host='localhost', port=5000, ssl_context=('cert.pem', 'key.pem'))
我的 R 闪亮代码:
library(shiny)
ui <- fillPage(
htmlOutput("frame")
)
server <- function(input, output) {
output$frame <- renderUI({
tags$iframe(src="https://localhost:5000/data", style='width:100vw;height:100vh;')
# tags$iframe(src="https://www.bbc.co.uk/sport", style='width:100vw;height:100vh;')
})
}
shinyApp(ui, server)
解决方案
推荐阅读
- ios - 如何使用 scaleAspectFill 为 UIImageView 设置约束,使其高度保持在可用空间内?
- terraform - 从私有 gcr 中提取的 Terraform GKE 问题
- javascript - 实时更新总量
- c# - 对 GET 方法的响应是 404 “Cannot GET” 错误
- c - 在 C 中制作通用单链表。将未知数据(void)复制到结构中的指针
- c++ - 函数定义或声明错误;未调用函数
- c++ - Cin 数组移入函数错误 C++
- php - 方法 Illuminate\Support\Collection::select 不存在
- javascript - 续集急切加载,“字段列表”中的未知列
- java - 使用二进制序列化加载菜单