avoid empty error messages
don't leave dangling callback functions on network error
respect WebSocket connection state and errors
resend all buffered messages after reconnect
test elaboration
support testing in Docker