diff --git a/lib/transports/websocket.js b/lib/transports/websocket.js
index <HASH>..<HASH> 100644
--- a/lib/transports/websocket.js
+++ b/lib/transports/websocket.js
@@ -51,9 +51,17 @@
    */
 
   WS.prototype.open = function () {
-    var Socket = 'MozWebSocket' in window ? MozWebSocket : WebSocket
-      , query = io.util.query(this.socket.options.query)
-      , self = this;
+    var query = io.util.query(this.socket.options.query)
+      , self = this
+      , Socket
+
+    // if node
+    Socket = require('websocket-client').WebSocket;
+    // end node
+
+    if (!Socket) {
+      Socket = window.MozWebSocket || window.WebSocket;
+    }
 
     this.websocket = new Socket(this.prepareUrl() + query);
 
@@ -143,6 +151,9 @@
    */
 
   WS.check = function () {
+    // if node
+    return true;
+    // end node
     return ('WebSocket' in window && !('__addTask' in WebSocket))
           || 'MozWebSocket' in window;
   };
Fixed support for Node.JS running `socket.io-client`.