【发布时间】:2021-05-30 18:21:00
【问题描述】:
我正在尝试创建一个超级简单的网站,只是为了显示内容并让另一个页面能够更改页面上的所述内容。 (安全性是 0 问题,因此请随时发布非常粗略的答案)。
但是当我访问该站点(托管在 NGINX 后面的数字海洋服务器上)时,我收到以下错误:
Refused to connect to wss://subdomain.domain.online/socket.io/?EIO=4&transport=websocket&sid=SIDHERE because it appears in neither the connect-src directive nor the default-src directive of the Content Security Policy.
我四处寻找并制定了以下政策:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline' wss: ws: *; connect-src 'self' ws: wss: *;">
但仍然出现错误,我想知道是否有人知道修复方法。
干杯,山姆。
【问题讨论】:
标签: html node.js security socket.io content-security-policy