I need to keep persistent PHP and socket.io connection. PHP script should serve as client (listen for socket.io events and emit back to socket.io). Is it even possible? Where should I start?
You can try use Ratchet for it.
Ratchet is a loosely coupled PHP library providing developers with tools to create real time, bi-directional applications between clients and servers over WebSockets. This is not your Grandfather's Internet