My client side laravel-echo is not sending cookie param in headers, braodcasting/auth requires a cookie in headers to authorize websocket connection, when I try sending the same request with fetch it works but not when my laravel echo is involved, how can I send the cookie param in headers
I tried a few tricks but it did not work.
window.Echo = new Echo({
broadcaster: 'reverb',
wsHost: 'localhost',
key: 'yn0yitpyoptuuqiyjrhm',
wsPort: 8080,
wssPort: 8080,
forceTLS: false,
authEndpoint: 'http://localhost:8000/broadcasting/auth',
headers: {
Authorization: `Bearer ${token}`,
Cookie: cookies,
},
withCredentials: true,
enabledTransports: ['ws', 'wss'],
});
New contributor
Arman Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.