500 内部错误 Laravel,通过 websocket 守护程序获取图像

500 internal error Laravel, getting images through websocket daemon

我在 Laravel 项目上有一个聊天守护程序 运行。

如果我尝试从服务器向客户端发送一个包含 HTML 的字符串,我会收到 500 错误(不是 404,文件存在。这是一个字符串示例

<img src="{{ asset('path/to/img.png') }}">

这是我在 PHP 日志中得到的错误:

request exceeded the limit of 10 internal redirects due to probable configuration error. use 'limitinternalrecursion' to increase the limit if necessary. use 'loglevel debug' to get a backtrace.

再说一次:如果我在客户端(视图)中回显此字符串,它会没问题,但如果我像消息一样收到它(从服务器到客户端),我会收到错误消息。

已解决。函数 asset() 返回了一个 url,如下所示:

http://localhost/path/to/img.png 

问题出在缺少端口。我编辑了我的 .env 文件并更改了基础 url

来自

http://localhost 

http://localhost:8000