0

I have Linux base Cpanel hosting server, And my main web is running in PHP. Also in that server, I serve the NodeJS app on port 3000 and host 0.0.0.0 using PM2. NodeJs app running fine. but now I want to connect that socket from my PHP app. my PHP app is running on the main domain, ex: mydomain.com. i tried to connect socket using MY_SERVER_IP:3000 and mydomain.com:3000 but i not able to connect that socket.

How can i connect NodeJS socket from my PHP app?

Kaushik Makwana
  • 2,422
  • 9
  • 31
  • 50

1 Answers1

0

I believe one of the reasons that may make your socket app is not running on cPanel that you need to give it a port number between 30000 and 50000 instead of 3000

I struggled in this point till i found this article

navigate to the bottom of it then you will notice an orange quoted words that describe what I am talking about here in brief.

Ahmed Mabrouk
  • 31
  • 1
  • 6