Я следовал документации по настройке laravel-echo-server с redis в качестве драйвера широковещательной передачи.
Мне удалось присоединиться к созданному мною каналу, но в выводе команды DEBUG=* laravel-echo-server start
я получил это:
Server ready!
engine intercepting request for path "/socket.io/" +0ms
engine handling "GET" http request "/socket.io/?EIO=3&transport=polling&t=MapZmuQ" +1ms
engine handshaking client "qu2wNp4IrLre3oJeAAAA" +7ms
engine:socket sending packet "open" ({"sid":"qu2wNp4IrLre3oJeAAAA","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000}) +0ms
engine:socket sending packet "message" (0) +1ms
engine:polling setting request +0ms
engine:socket flushing buffer to transport +1ms
engine:polling writing "96:0{"sid":"qu2wNp4IrLre3oJeAAAA","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000}2:40" +2ms
engine:socket executing batch send callback +9ms
socket.io:server incoming connection with id qu2wNp4IrLre3oJeAAAA +492ms
socket.io:client connecting to namespace / +0ms
socket.io:namespace adding socket to nsp / +0ms
socket.io:socket socket connected - writing packet +0ms
socket.io:socket joining room qu2wNp4IrLre3oJeAAAA +0ms
socket.io:socket packet already sent in initial handshake +0ms
socket.io:socket joined room qu2wNp4IrLre3oJeAAAA +1ms
engine intercepting request for path "/socket.io/" +206ms
engine handling "POST" http request "/socket.io/?EIO=3&transport=polling&t=MapZm-U&sid=qu2wNp4IrLre3oJeAAAA" +1ms
engine setting new request for existing client +0ms
engine:polling received "121:42["subscribe",{"channel":"issueUpdates","auth":{"headers":{"X-CSRF-TOKEN":"GyZ4Z0igQp4gaMSiYgFrmXKOCsMX0zXnvOAxUZrr"}}}]" +193ms
engine:socket packet +186ms
socket.io-parser decoded 2["subscribe",{"channel":"issueUpdates","auth":{"headers":{"X-CSRF-TOKEN":"GyZ4Z0igQp4gaMSiYgFrmXKOCsMX0zXnvOAxUZrr"}}}] as {"type":2,"nsp":"/","data":["subscribe",{"channel":"issueUpdates","auth":{"headers":{"X-CSRF-TOKEN":"GyZ4Z0igQp4gaMSiYgFrmXKOCsMX0zXnvOAxUZrr"}}}]} +690ms
socket.io:socket got packet {"type":2,"nsp":"/","data":["subscribe",{"channel":"issueUpdates","auth":{"headers":{"X-CSRF-TOKEN":"GyZ4Z0igQp4gaMSiYgFrmXKOCsMX0zXnvOAxUZrr"}}}]} +183ms
socket.io:socket emitting event ["subscribe",{"channel":"issueUpdates","auth":{"headers":{"X-CSRF-TOKEN":"GyZ4Z0igQp4gaMSiYgFrmXKOCsMX0zXnvOAxUZrr"}}}] +0ms
socket.io:socket dispatching an event ["subscribe",{"channel":"issueUpdates","auth":{"headers":{"X-CSRF-TOKEN":"GyZ4Z0igQp4gaMSiYgFrmXKOCsMX0zXnvOAxUZrr"}}}] +0ms
socket.io:socket joining room issueUpdates +1ms
[10:03:27] - qu2wNp4IrLre3oJeAAAA joined channel: issueUpdates
socket.io:socket joined room issueUpdates +6ms
engine intercepting request for path "/socket.io/" +83ms
engine handling "GET" http request "/socket.io/?EIO=3&transport=polling&t=MapZm-U.0&sid=qu2wNp4IrLre3oJeAAAA" +0ms
engine setting new request for existing client +1ms
engine:polling setting request +83ms
engine upgrading existing transport +67ms
engine:socket might upgrade socket transport from "polling" to "websocket" +149ms
engine:ws received "2probe" +0ms
engine:ws writing "3probe" +1ms
engine:socket writing a noop packet to polling for fast upgrade +170ms
engine:polling writing "1:6" +238ms
engine:ws received "5" +185ms
engine:socket got upgrade packet - upgrading +83ms
engine:polling closing +84ms
engine:polling transport discarded - closing right away +0ms
engine:ws received "2" +25s
engine:socket packet +25s
engine:socket got ping +0ms
engine:socket sending packet "pong" (undefined) +0ms
engine:socket flushing buffer to transport +0ms
engine:ws writing "3" +1ms
Я вижу, что он получает пинг и отправляет понги, но я не знаю, почему мой event(new IssueCreated($issue))
Никогда не бросает канал и не транслируется.
Мой код переднего конца:
if (io !== 'undefined') {
console.log('subscribing..');
// Issue created code
Echo.channel('issueUpdates')
.listen('IssueCreated', (e) => {
console.log('new issue');
console.log(e);
});
}
Я понял, что успешно вошел в комнату, но когда я запускаю событие, оно не отображается ни в моем журнале laravel-echo-server, ни в моем console.log
Что я могу сделать для отладки?и, пожалуйста, дайте мне знать, если вам нужна дополнительная информация.