0

I want to connect my React app with Laravel Reverb. When connecting to a public channel everything works fine. but when trying to connect to a private channel I get connection refused

My React Code

import Pusher from 'pusher-js';
import Echo from 'laravel-echo';
window.pusher = require('pusher-js')

window.Echo = new Echo({
  broadcaster: 'reverb',
  key: 'MY_KEY', 
  wsHost: 'localhost',
  wsPort: 8080,
  // wssPort: 8080,
  forceTLS: false,
  // enabledTransports: ['ws'],
  authEndpoint: 'http://localhost:8000/broadcasting/auth',
  auth: {
    headers: {
      Authorization: `Bearer 3|2sMx5JrUWHjuTDyczuRn40vhsm5JL10jqxJpbyvfdbc9bfe4`
    }
  }
});


  window.Echo.private('private-channel.user.1')
    .listen('PrivateEvent', (e) => {
      console.log(e);
    })

0