How to run Ratchet remotely or on a server?

◇◆丶佛笑我妖孽 提交于 2019-12-04 14:11:12
$server = IoServer::factory(
new HttpServer(
    new WsServer(
        new Chat()
    )
),
8282

);

Just Change the port and try.. mine is works fine after changing my port. And also don't forget to change the port in your port in websocket javascript class too.

var conn = new WebSocket('ws://yourdomain.com:8282');

I later found out using other ports are not allowed on a shared server.

If you are on a private server with a ssh access, you can try MarshallOfSound's solution.

Or if you just need the websocket as a service you can use something like Pusher.

It means that nother process is running on port 8080. Probably a webserver of some kind.

You can find out what is running with the command

lsof -i :8000

You can either stop the process already using the port. Or run Ratchet on a different port.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!