From 64b1eae38c1f754657d6154f5c2e627eae44b742 Mon Sep 17 00:00:00 2001 From: Tony Lee Date: Wed, 26 Jul 2017 15:38:30 +0800 Subject: [PATCH] added constants to fully comply to standard websocket --- robust-websocket.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/robust-websocket.js b/robust-websocket.js index 8835c5c..60ae0d1 100644 --- a/robust-websocket.js +++ b/robust-websocket.js @@ -175,6 +175,12 @@ }) }) + ;['CLOSED', 'CLOSING', 'CONNECTING', 'OPEN'].forEach(function (name) { + Object.defineProperty(self, name, { + value: WebSocket[name] + }); + }) + attachConnectivityEvents() }