问题:
套接字连接成功,其状态为 101。但在事件调用中没有得到任何数据。
注意:一切都在本地服务器上完美运行。
Alt-Svc: h3-24=":8443"; ma=86400, h3-23=":8443"; ma=86400
CF-Cache-Status: DYNAMIC
CF-RAY: 5555c1ef7d12d600-MXP
Connection: upgrade
Date: Wed, 15 Jan 2020 06:22:51 GMT
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Sec-WebSocket-Accept: kdvICu1oe8EKBkC5xoqRFMkJruA=
Server: cloudflare
Upgrade: websocket
X-Powered-By: Ratchet/0.4.1
broadcasting.php 推送器连接:
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
'encrypted' => true,
'host' => '127.0.0.1',
'port' => 8443,
'scheme' => 'https',
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
]
],
回声配置:
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
cluster: process.env.MIX_PUSHER_APP_CLUSTER,
encrypted: true,
disableStats: true,
wsHost: window.location.hostname,
wsPort: 8443,
wssPort: 8443,
});
注意:我正在使用 cloudflare。