websocket connection handling for Safari
related to issue #12