Added support for older version of WebSocket, so that it works on Safari and iPad