phpsocket.io
phpsocket.io copied to clipboard
Client side not connecting?
Hi,
I am trying to run on my server (Centos 7), but I get the following error:
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.
Security group?
Hi, I'm not sure what you mean by Security group, how do I check that please?
For example, if you use aws you should config your securityGroups. https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html
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.:
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?
I can't help more. It looks like a server network problem, and I think you should go to ionos.com ask for help.
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.