send(JsonResponse::create($response)->send()); $conn->close(); } /** * Triggered when a client sends data through the socket * @param \Ratchet\ConnectionInterface $from The socket/connection that sent the message to your application * @param string $msg The message received * @throws \Exception */ function onMessage(ConnectionInterface $from, $msg) { // } abstract public function __invoke($request); }