title: PHP Websocket to Node/Sockjs
body: <p>I have a NodeJS server with SockJS. Clients connect to the node server fine creating a websocket through the browser. The problem is trying to create a websocket from php to node.</p>
  
  <p>I am using the file at <a href="https://github.com/lemmingzshadow/php-websocket/blob/master/client/lib/class.websocket_client.php" rel="nofollow">https://github.com/lemmingzshadow/php-websocket/blob/master/client/lib/class.websocket_client.php</a> as a means to create the websocket in php.</p>
  
  <p>the server is running on port 9999 and the connection is made in the browser with wss://nodejs.example.com:9999/sockjs/websocket. The server notes the connection made via a console.log</p>
  
  <p>Thusly I pass in nodejs.example.com, 9999, sockjs/websocket into the host, port and path fields respectively.</p>
  
  <p>The node server however never sees the get connection issued. </p>
  
  <p>(The thoughts behind this is the server has a heavy php backend installed and by having it tell node when to send data to the clients we can have more real time interactions and remove polling without having to do a full blown switchover).</p>
  
  <p>TLDR: I want to be able to send messages to a NodeJS/SockJS server from PHP</p>