I had the same issue, and my problem was that the broadcast payload was too big, which caused it to crash. Ensure that you check if you are broadcasting a large amount of data and chunk it accordingly if necessary.
cURL error 56: Recv failure: Connection was reset when dispatch an event
several days ago, i was playing with reverb and it work fine, idk why today my broadcast message has stop working.
im on local development and i think i dont have any issue with my configuration, since i've try to reinstall again and again, test it on another pc, and it still suck.
what i have do is just use livewire table to one of my pages, and i think its not the problem.
here's my configuration: .env
REVERB_HOST="localhost"
REVERB_PORT=8081
REVERB_SCHEME=http
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"
echo.js
import Echo from 'laravel-echo';
import Pusher from 'pusher-js';
window.Pusher = Pusher;
window.Echo = new Echo({
broadcaster: 'reverb',
key: import.meta.env.VITE_REVERB_APP_KEY,
wsHost: import.meta.env.VITE_REVERB_HOST,
wsPort: import.meta.env.VITE_REVERB_PORT,
wssPort: import.meta.env.VITE_REVERB_PORT,
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
});
channel.js
document.addEventListener('DOMContentLoaded', function () {
if (userId) {
// define Echo sebagai global variable
window.Echo.private(`notifications.${userId.content}`)
.listen('.exportCompleted', (data) => {
console.log(data);
handleNotification(data);
})
.listen('.newTaskAssigned', (data) => {
handleNotification(data);
})
.listen('.collectorUpdatedReport', (data) => {
handleNotification(data);
})
.listen('.salesNewReport', (data) => {
handleNotification(data);
})
.listen('.backupReady', (data) => {
console.log(data);
showToast('success', 'Cadangan berhasil dibuat.');
Livewire.dispatch('pg:eventRefresh-BackupTable');
});
window.Echo.private(`announcements.${userId.content}`)
.listen('.newAnnouncement', (data) => {
console.log(data);
handleAnnouncement(data);
});
}
}
when i debug the ws/wss result, it communicate each other saying ping and pong like it should be working right? idk whats wrong ps: php artisan reverb:start --port=8081 --debug say it communicate each other too..
Please or to participate in this conversation.