NetworkClient.SendMessage to other clients

I have an app. One instance on some device can be server (NetworkServer.Listen), and the other(s) are client (NetworkClient.Connect). Clients can send messages to server using Unity’s UNET message system, system.
Is there a way for client to send message to the other clients?

Directly, I don’t think so.

I believe you would have to go through the server. Something like this should work:

NetworkClient.Send(CustomMessages.ToClients, YourMessageObject)

On server you’d do maybe

NetworkServer.SendToAll(CustomMessages.ToClients, TheAboveMessageObject)

or to ensure whoever sent it doesn’t get the same message you could do something like…

foreach(NetworkConnection conn in NetworkServer.connections)
{
    if(!conn.equals(netMsg.conn)
    {
        NetworkServer.SendToClient(conn.connectionId, CustomMessages.ToClients, TheAboveMessageObject)
    }
}

and of course both client and server have to RegisterHandler(CustomMessages.ToClients, SomeHandler)

I thought about this solution. The problem is, Client may send different MessageBase-derived messages, and handlers can be found in every class of my app. I can’t send message with MessageBase type field. Right now I’m looking for another solution, maybe I’ll start use NetworkTransport or NetworkBehaviour with RPC, though I didn’t want that for some reasons.