Move creation of websocket connection to its own method, so subclasses can override