phpsocket.io icon indicating copy to clipboard operation
phpsocket.io copied to clipboard

Client side not connecting?

Open carlo-fontanos opened this issue 4 years ago • 6 comments

Hi,

I am trying to run on my server (Centos 7), but I get the following error:

image

net::ERR_CONNECTION_TIMED_OUT

I have enabled public access to port: 2120 using the following :

firewall-cmd --zone=public --add-port=2120/tcp --permanent
firewall-cmd --reload

But still not working. Any solution please?

The code works in my localhost.

carlo-fontanos avatar Nov 17 '20 10:11 carlo-fontanos

Security group?

walkor avatar Nov 17 '20 11:11 walkor

Hi, I'm not sure what you mean by Security group, how do I check that please?

carlo-fontanos avatar Nov 17 '20 12:11 carlo-fontanos

For example, if you use aws you should config your securityGroups. https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html

walkor avatar Nov 17 '20 13:11 walkor

Hi, thank you for your reply. I am not using AWS. I purchased my VPS from ionos.com. I installed Centos 7 OS in it.

You can see below that that the port 2120 is open in firewall.:

image

I am not sure why my client side is not able to connect., the server side is able to send message properly.

<script src='https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.1/socket.io.min.js'></script>
<script> 
var socket = io('http://' + document.domain + ':2120');
</script>

Any other recommendations please?

carlo-fontanos avatar Nov 17 '20 13:11 carlo-fontanos

I can't help more. It looks like a server network problem, and I think you should go to ionos.com ask for help.

walkor avatar Nov 17 '20 13:11 walkor

In my case @carlo-fontanos I had to do an extra work, I used a proxy on my apache configuration to get things up and running. I don't know if the could the same for you.

binemmanuel avatar Mar 10 '22 20:03 binemmanuel