client abstraction for ws connection