godot4导出WEB遇到的问题

06-01 1866阅读

问题一、

The following features required to run Godot projects on the Web are missing:

Cross-Origin Isolation - Check that the web server configuration sends the correct headers.

SharedArrayBuffer - Check that the web server configuration sends the correct headers.

godot4导出WEB遇到的问题

解决办法

 一般由于开启了多线程导致。

godot4导出WEB遇到的问题

Web 服务器配置缺少Cross-Origin-Embedder-Policy、Cross-Origin-Opener-Policy

w.Header().Set("Cross-Origin-Embedder-Policy", "require-corp")
w.Header().Set("Cross-Origin-Opener-Policy", "same-origin")

问题二、出现乱码

godot4导出WEB遇到的问题

解决办法:

项目设置---》GUI---》主题。设置自定义字体。

godot4导出WEB遇到的问题

问题三、

godot的web部署后都需要https访问,自行申请。如果使用nakama框架的,因为其接口一般都是http访问的,还需要反向代理一下。

godot4导出WEB遇到的问题

反向代理:

server {
        listen 8850 ssl;
        server_name xxxx;#注意:这里是自己申请的域名
        index index.html index.htm index.php;
    
        #error_page   404   /404.html;
        include enable-php.conf;
        
        ssl_certificate /www/server/panel/vhost/cert/webserver/fullchain.pem;
        ssl_certificate_key /www/server/panel/vhost/cert/webserver/privkey.pem;
        
        location / {
            proxy_pass http://127.0.0.1:7350;#反向代理的本地端口
            proxy_set_header Host 127.0.0.1:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header REMOTE-HOST $remote_addr;
            add_header X-Cache $upstream_cache_status;
            # add_header X-Content-Type-Options "nosniff";
            proxy_set_header X-Host $host:$server_port;
            proxy_set_header X-Scheme $scheme;
            proxy_connect_timeout 15s;
            proxy_read_timeout 86400s;
            proxy_send_timeout 30s;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
    }
    }
免责声明:我们致力于保护作者版权,注重分享,被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理! 图片声明:本站部分配图来自人工智能系统AI生成,觅知网授权图片,PxHere摄影无版权图库和百度,360,搜狗等多加搜索引擎自动关键词搜索配图,如有侵权的图片,请第一时间联系我们。

相关阅读

目录[+]

取消
微信二维码
微信二维码
支付宝二维码