20 lines
605 B
JavaScript
20 lines
605 B
JavaScript
import Echo from 'laravel-echo'
|
|
import Pusher from 'pusher-js'
|
|
window.Pusher = Pusher
|
|
|
|
const host = import.meta.env.VITE_REVERB_HOST || window.location.hostname
|
|
const port = Number(import.meta.env.VITE_REVERB_PORT) || 443
|
|
const scheme = (import.meta.env.VITE_REVERB_SCHEME || 'https').toLowerCase()
|
|
const tls = scheme === 'https'
|
|
|
|
window.Echo = new Echo({
|
|
broadcaster: 'reverb',
|
|
key: import.meta.env.VITE_REVERB_APP_KEY,
|
|
wsHost: host,
|
|
wsPort: port,
|
|
wssPort: port,
|
|
forceTLS: tls,
|
|
enabledTransports: ['ws','wss'],
|
|
wsPath: import.meta.env.VITE_REVERB_PATH || '/ws',
|
|
})
|