Closed DGINXREAL closed 1 month ago
const 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'],
auth: {
headers: {
Authorization: 'Bearer XXX',
"Accept": "application/json",
"Content-Type": "application/json",
}
},
authorizer: (channel: any) => {
return {
authorize: (socketId: string , callback: Function) => {
console.log('AAA')
sr.post('https://' + import.meta.env.VITE_API_HOST + '/broadcasting/auth', {
socket_id: socketId,
channel_name: channel.name
})
.then(response => {
callback(false, response.data);
})
.catch(error => {
callback(true, error);
});
}
};
},
});
Hi there,
whisper
should already be added to interface via https://github.com/laravel/echo/pull/377. However, you are free to submit PR to improves this to cover above usage.
Echo Version
1.16.1
Laravel Version
N/A
PHP Version
N/A
NPM Version
10.5.1
Database Driver & Version
N/A
Description
I got an issue with Typescript that says that the whisper methode is not available on Channel
But the code works fine in dev mode.
Steps To Reproduce
See description