20 lines
561 B
JavaScript
20 lines
561 B
JavaScript
import Echo from 'laravel-echo';
|
|
|
|
import Pusher from 'pusher-js';
|
|
window.Pusher = Pusher;
|
|
|
|
const appKey = import.meta.env.VITE_REVERB_APP_KEY;
|
|
const host = import.meta.env.VITE_REVERB_HOST;
|
|
|
|
if (appKey && host) {
|
|
window.Echo = new Echo({
|
|
broadcaster: 'reverb',
|
|
key: appKey,
|
|
wsHost: host,
|
|
wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
|
|
wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
|
|
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
|
|
enabledTransports: ['ws', 'wss'],
|
|
});
|
|
}
|