SocketIO + Redis 连接关闭

SocketIO + Redis Connection Closed

我按照提供的文档进行操作,但服务器似乎不接受连接:

(failed)
net::ERR_CONNECTION_CLOSED

在应用 laravel-echo-server start 命令后,服务器似乎已启动并且 运行:

L A R A V E L  E C H O  S E R V E R

version 1.3.6

⚠ Starting server in DEV mode...

✔  Running at localhost on port 6001
✔  Channels are ready.
✔  Listening for http events...
✔  Listening for redis events...

Server ready!

bootstrap.js:

import Echo from 'laravel-echo'

window.io = require('socket.io-client');

window.Echo = new Echo({
    broadcaster: 'socket.io',
    host: window.location.hostname + ':6001',
});

.env:

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=redis

REDIS_HOST=localhost
REDIS_PASSWORD=null
REDIS_PORT=6379

laravel-echo-server.json

{
    "authHost": "http://dialfy.local",
    "authEndpoint": "/broadcasting/auth",
    "clients": [
        {
            "appId": "dd4d563e7e81f442",
            "key": "1627b6fd226c7f3c866ca209f78779b6"
        }
    ],
    "database": "redis",
    "databaseConfig": {
        "redis": {},
        "sqlite": {
            "databasePath": "/database/laravel-echo-server.sqlite"
        }
    },
    "devMode": true,
    "host": null,
    "port": "6001",
    "protocol": "http",
    "socketio": {},
    "sslCertPath": "",
    "sslKeyPath": "",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "apiOriginAllow": {
        "allowCors": false,
        "allowOrigin": "",
        "allowMethods": "",
        "allowHeaders": ""
    }
}

关于问题可能是什么,或者我可以从哪里开始寻找的任何想法?我想这是一个配置问题,但我似乎无法确定。

对于遇到类似问题的任何其他人:原因是因为我的应用程序在本地 https 上 运行,而我没有配置 laravel-echo-server 来做同样的事情。