如何在 html iframe 中使用 heroku 应用程序?

How to use a heroku app inside a html iframe?

我想在 iframe 中使用这个 heroku 应用程序(spring 启动)。 https://sef-github-leaderboard.herokuapp.com/ 但它不起作用。它说 refused to connect。这是代码。

<!DOCTYPE html>
<html>
<body>

<iframe src="https://sef-github-leaderboard.herokuapp.com/" title="Iframe Example" style="height:500px;width:100%;"></iframe>

</body>
</html>

如果你打开 devtools,点击 Network 选项卡,刷新页面,然后点击瀑布中的第一项,你会发现 Content Security Policy header X-Frame-Options is set to DENY on the URL you are seeking to embed. This instructs the browser to disallow loading the page within an iframe. To get around this, you would need to use a forward proxy 去掉了 headers。