Php ratchet websocket $conn->send($msg)! How to get this messenge in client?

#1

Here my code (websocket php using rachet and wamp server!

public function onClose(ConnectionInterface $conn) {
  $conn->send("Close client");
}

I will using $conn->send() to send a message for all client but i don’t know how to get this message using autobahnJS on client?

and here my client code :

                       var conn=new ab.Session("ws://127.0.0.1:8080",

					function (session) {

  							console.log ("dddsddd");

							conn.subscribe('{{app.user.id}}');

					 }

					,function (code, reason, detail) {console.log ("dddd");},

					{

					      'maxRetries': 60,

					      'retryDelay': 2000

					}

					);
0 Likes