Listen to a specific port


I would like to know if it is possible to connect to an application to a specific port.

I am trying to have a websocket server (using php ratchet library) to run on port 3000. Trying to connect to the websocket server from the terminal (using works just fine. I cannot make it work if I try from a client (I tried using app-url:3000).

I imagine the internals of the url routing and port listening is at fault.

So is this something that can be done? And if yes, should I use a specific port or what is the preferred way?

Thanks very much,

Edit: I also tried using the public ip of the application, but still no luck.


@spahar I would like to inform you that there are a limited number of Ports publically listens on Cloudways stack due to security reasons. Therefore, you are able to connect to your socket via localhost but not publically.

I will suggest you to contact Cloudways support via live chat or support ticket, I am sure they might be able to provide you some work around.


Thanks for the reply.

I thought so. I’ll contact them to examine if they can open a port on request.