-1

I am trying to use laravel websockt on ubuntu server. it is working fine on localhost but on ubuntu server when i try to connect it is not working.

In console I am receiving this error

WebSocket connection to 'ws://domain.xyz:6001/app/91407296bd1107c7321?protocol=7&client=js&version=7.0.3&flash=false' failed:

I almost have given all all port permission in my inbound rule of ec2

enter image description here

Don't know Why it is not still working Any idea?

Bilal Arshad
  • 531
  • 3
  • 11
  • 33

1 Answers1

0

It was required to enable ufw firewall I followed this article

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-18-04 also, make sure you js settings is according to this

new Pusher('1', {

            cluster: 'ap2'
            , forceTLS: false
            , wsHost: window.location.hostname,
            wsPort: 6001,
            wssPort:6001,
           disableStats: true,
        });
Bilal Arshad
  • 531
  • 3
  • 11
  • 33