Skip to content Skip to sidebar Skip to footer

Socket.io + Php + Is This A Realistic Solution At This Point In Time

I have been reading about websockets and also about socket.io. I understand websockets are not support but enough browsers yet to be realistically used. socket.io has browser suppo

Solution 1:

Trying to make PHP talk to socket.io I suspect will be a big task.

Certainly it's not a great idea to run websockets via a pre-fork or threaded apache. Any event based server should be OK if you can handle the number of PHP processes. A better approach would be to write an event based server in php. Like this one

Solution 2:

i researched a few websocket server implementations. i read, that there is a way to use node.js in production. using apache many years, i also searched for a module to handle websockets within apache, but found only half-hearted stuff. nothing which seemed solid.

i stumbled upon yaws, which is a websocket capable server written in erlang, which has the advantages of beeing the right language for a highly parallel application such as the chat thing, and also because websockets should be well integrated within the main server.

now, i'm developing a php chat server, which uses a framework called ratchet. -> google for 'ratchet php'. they got a good tutorial.

i start it via the commandline, and although for you it should be possible to also start the ratchet server via a browser call, i would not recommend that.

so in your constrained hosting environment, i would stick to ajax.

Post a Comment for "Socket.io + Php + Is This A Realistic Solution At This Point In Time"