title: Connecting to a WebSocket PHP server (code 1006 "Abnormal Closure")
body: <p>I cannot establish a connection with the PHP WebSocket server, client closes it with code 1006 "Abnormal Closure".</p>
  
  <p>Client code:</p>
  
  <blockquote>
    <p>var host = "ws://example.com:1234/test/server.php";</p>
  </blockquote>
  
  <p>Server Code (test/server.php):</p>
  
  <blockquote>
    <p>$host = 'tcp://example.com:1234';</p>
  </blockquote>
  
  <ol>
  <li>I tried different WebSocket PHP libraries.</li>
  <li>I tried different hosts ("127.0.0.1", "0.0.0.0", "example.com").</li>
  <li><code>sudo netstat -plnt</code> shows that port is listened.</li>
  <li>Appropriate TCP port is opened (firewall settings in ISPConfig 3).</li>
  </ol>
  
  <p>But connection still not working. Any ideas?</p>
  
  <p>Thank you in advance.</p>