Add example of writing json messages to connection