docs: function BlynkClientNode(n) {
          // Create a RED node
          RED.nodes.createNode(this, n);
          var node = this;
          node.msg_callbacks = [];
          // Store local copies of the node configuration (as defined in the .html)
          node.path = n.path;
          node.key = n.key;
  
          node._inputNodes = []; // collection of nodes that want to receive events
          node._clients = {};
          // match absolute url
          node.closing = false;
          node.logged = false;
  
          node.setMaxListeners(100);
  
          node.pinger = setInterval(function() {
              //only ping if connected and working
              if (node.logged) {
                  node.ping();
              }
          }, 5000);
  
          node.closing = false;
  
          function startconn() { // Connect to remote endpoint
              //should not start connection if no server or key
              node.log(RED._("Start connection: ") + node.path);
              node.logged = false;
              var socket = new ws(node.path);
              node.server = socket; // keep for closing
              socket.setMaxListeners(100);
  
              socket.on('open', function() {
                  node.login(node.key);
              });
  
              socket.on('close', function() {
                  node.log(RED._("Connection closed: ") + node.path);
                  node.emit('closed');
                  node.logged = false;
                  if (!node.closing) {
                      clearTimeout(node.tout);
                      node.tout = setTimeout(function() {
                          startconn();
                      }, 5000); // try to reconnect every 5 secs... bit fast ?
                  }
              });
  
              socket.on('message', function(data, flags) {
                  var cmd = decodeCommand(data);
                  if (cmd.type == MsgType.RESPONSE && cmd.msgId && cmd.msgId <= node.msg_callbacks.length) {
                      var err = null
                      if (cmd.status != MsgStatus.OK) {
                          err = cmd.status
                      }
                      node.msg_callbacks[cmd.msgId - 1](cmd, err)
                      node.msg_callbacks.splice(cmd.msgId - 1, 1);
                  } else {
                      switch (cmd.type) {
                          case MsgType.HARDWARE:
                              switch (cmd.operation) {
                                  //input nodes
                                  case 'vw':
                                      node.handleWriteEvent(cmd);
                                      break;
                                  case 'vr':
                                      node.handleReadEvent(cmd);
                                      break;
                                  default:
                                      node.warn(RED._("Unhandled HARDWARE operation: ") + messageToDebugString(data));
                              }
                              break;
                          default:
                              node.warn(RED._("Unhandled operation type: ") + messageToDebugString(data));
                      }
                  }
              });
              socket.on('error', function(err) {
                  node.error(RED._("Socket error: ") + err);
                  node.emit('erro');
                  node.logged = false;
                  if (!node.closing) {
                      clearTimeout(node.tout);
                      node.tout = setTimeout(function() {
                          startconn();
                      }, 5000); // try to reconnect every 5 secs... bit fast ?
                  }
              });
          }
  
          node.on("close", function() {
              // Workaround https://github.com/einaros/ws/pull/253
              // Remove listeners from RED.server
              node.closing = true;
              node.logged = false;
              node.server.close();
              if (node.tout) {
                  clearTimeout(node.tout);
              }
          });
  
          startconn(); // start outbound connection
  
      }