我正在尝试编写一个与Symfony 5和Mercure的聊天代码,但我在配置方面遇到了一些问题。我使用的是Windows10。
这是我遵循的文档:https://github.com/dunglas/mercure/blob/main/docs/hub/install.md
我在我的项目中安装了这个版本: mercure_0.13.0_Windows_arm64.zip。然后,我解压了它,在我的终端中,我运行了"composer require symfony/mercure“。
这是在我的.env中
# See https://symfony.com/doc/current/mercure.html#configuration
# The URL of the Mercure hub, used by the app to publish updates (can be a local URL)
MERCURE_URL=:https://127.0.0.1:8000/.well-known/mercure
# The public URL of the Mercure hub, used by the browser to connect
MERCURE_PUBLIC_URL=https://127.0.0.1:8000/.well-known/mercure
# The secret used to sign the JWTs
MERCURE_JWT_SECRET="!ChangeMe!"
###< symfony/mercure-bundle ###```
Then I ran the Mercure server with this command line : ```$env:MERCURE_PUBLISHER_JWT_KEY='!ChangeMe!'; $env:MERCURE_SUBSCRIBER_JWT_KEY='!ChangeMe!'; .\mercure.exe run -config Caddyfile.dev```.
In my PowerShell, I have this :
```2021/11/16 01:39:58.029 INFO http server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}2021/11/16 01:39:58.029信息http启用自动server_name->HTTPS重定向{"server_name":"srv0"}
2021/11/16 01:39:58.111 INFO tls清洗存储单元{"description":"FileStorage:C:\Users\toufi\AppData\Roaming\Caddy"}
2021/11/16 01:39:58.113 INFO tls已完成清洗存储单元
2021/11/16 01:39:58.134 INFO pki.ca.local根证书已被系统信任{"path":"storage:pki/authorities/local/root.crt"}
2021/11/16 01:39:58.135启用自动TLS证书管理的信息http {“domain”:"localhost"}
2021/11/16 01:39:58.136 WARN tls装订OCSP {"error":“没有本地主机的OCSP装订:证书中没有指定OCSP服务器”}
2021/11/16 01:39:58.143信息自动保存的配置(使用--恢复标志加载){“文件”:"C:\Users\toufi\AppData\Roaming\Caddy\autosave.json"}
2021/11/16 01:39:58.143信息服务初始配置`
它看起来运行得很好,但在我的浏览器中运行https://localhost/.well-known/mercure时,
我有:
The requested URL was not found on this server.
Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/7.4.25 Server at localhost Port 443```
Someone can help me because I don't know how to access to my Mercure server with my browser ?
Thank you very much发布于 2021-11-16 09:26:22
嘿,本,你应该试着用你的浏览器而不是https://localhost/.well-known/mercure来运行https://localhost:8000/.well-known/mercure
https://stackoverflow.com/questions/69982961
复制相似问题