title: WebSocket server in PHP without daemons?
body: <p>I will try to make my first post here as interesting as possible.</p>
  
  <p>Lately I have been interested in the feasibility of handling WebSocket requests on a shared hosting server.</p>
  
  <p>Please don't tell me "upgrade your plan". All this would be trivial on at least a VPS. I realize that.</p>
  
  <p>As many know, shared hosts will...</p>
  
  <ul>
  <li>Kill a daemon if they see one</li>
  <li>Block usage of server sockets</li>
  <li>Deny you shell access</li>
  <li>Keep apache off limits (no module installations)</li>
  </ul>
  
  <p>These restrictions eliminate phpwebsocket, python altogether. A no-daemon solution that masquerades as a web page is needed.</p>
  
  <p>PHP being my favorite server-side language, I crafted a PHP websocket gateway posing as a web page.</p>
  
  <p>So far I have been successful in sending the right headers for the handshake and streaming output (using output buffering), but I still can't figure out how to continue to read data after the initial request.</p>
  
  <p>In short, I want to continue to receive data from the client even after the PHP script is started. I have tried reading the php://input pseudofile, but I can't seem to get any more reads out of it after the end of the GET. Is there any setting or hack that will allow this?</p>
  
  <p>Thanks!</p>