I want to ask you guys, how to make my php (or python) socket server to start when a client make request to a specific file and to stop, when client stops. Also, is there a way to make a php or python socket server not to open any ports (maybe to use port 80, which I think is possible, thanks to the request above). I'm using a public hosting which doesn't allow me to open ports or to use terminal commands.
Erm, sorry, you can't do WebSockets (at least not properly to my knowledge) without opening ports. You might be able to fake it with PHP, but the timeout would defeat it.
I would recommend Comet AJAX/long-polling instead.
html5 websockets OR flash sockets activated on load?