Although our wallet implementation does most of the heavy lifting involved in managing your state channels, one thing it does not take responsibility for is message routing. For now, you must handle this in your Dapp.
To do so, you should
Subscribe to outbound messages using the channel client's
onMessageQueuedmethod. The wallet will emit events containing messages for counterparties in the state channel. When such a message is emitted, you need to route it to its recipient.
Push inbound messages into the wallet using the channel client's
Here's an example using a cloud database (Google firebase) to route messages to and from a participant we call "hub":