Diego Michel
Diego Michel

Reputation: 63

Is there a way to use PHP WebSocket in Heroku?, it seems by default there's only support for other technologies

I've made a chat room app, I tested locally and it works, but when I deploy it to heroku, there's a CONNECTION REFUSE ERROR, I saw that heroku now support WebSocket, but it seems it's only for all supported technologies but PHP.

Upvotes: 6

Views: 653

Answers (1)

kayleighsdaddy
kayleighsdaddy

Reputation: 660

Yes you can use WebSocket in Heroku. PHP is a very difficult language in general when it comes to WebSockets and I would recommend a different one. But regardless of what I think, you may do as you please. If you are using Heroku, you have to follow the standard rules of idle. If a program reminds idle for 55 seconds the program will be terminated. The way to handle this would be to send a ping message from the server every 30ish seconds.

https://devcenter.heroku.com/articles/websockets

Upvotes: 1

Related Questions