0

I have implemented websocket in laravel framework. It is working fine on localhost windows OS but giving error on live ubuntu server

["Connecting",{"transport":"ws","url":"ws://IP-Address:6001/app/qwerty?protocol=7&client=js&version=7.0.0&flash=false"}]

I think this is error because port is not allowing to connect. but i am not sure about it. What should i do? I am using aws webservices

Added rule enter image description here

Bilal Arshad
  • 531
  • 3
  • 11
  • 33
  • If you SSH to the AWS instance you are hosting this can you connect to the websocket via the SSH terminal? – apokryfos Oct 02 '20 at 07:25
  • You can try to configure the security group rules to allow incoming connections to that port from outside. If you're hosting this on EC2 then you can go to the EC2 web interface and add an inbound rule to the security group attached to your instance – apokryfos Oct 02 '20 at 07:28
  • i tried but i really dont understand what i need to do there – Bilal Arshad Oct 02 '20 at 07:30
  • When you're editing the security group there's two tabs: Inbound and Outbound rules. In the Inbound rules add a rule for TCP connections to allow all connections to port 6001 from any IP (I think you can specify any IP as 0.0.0.0) . There's more info [here](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-security-groups.html#adding-security-group-rule) – apokryfos Oct 02 '20 at 07:34
  • ok let me try again – Bilal Arshad Oct 02 '20 at 07:36
  • I added rule.. check screen shot at top – Bilal Arshad Oct 02 '20 at 07:39
  • I would suggest not using "All TCP" but just TCP with the specific port you want to open up to traffic – apokryfos Oct 02 '20 at 08:44
  • That Problem is solved but new problem is arises.Now getting this error ``` Error in connection establishment: net::ERR_CONNECTION_REFUSED ``` – Bilal Arshad Oct 02 '20 at 08:51

0 Answers0