You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
713 B

7 years ago
  1. /*!
  2. * ws: a node.js websocket client
  3. * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  4. * MIT Licensed
  5. */
  6. module.exports = {
  7. isValidErrorCode: function(code) {
  8. return (code >= 1000 && code <= 1011 && code != 1004 && code != 1005 && code != 1006) ||
  9. (code >= 3000 && code <= 4999);
  10. },
  11. 1000: 'normal',
  12. 1001: 'going away',
  13. 1002: 'protocol error',
  14. 1003: 'unsupported data',
  15. 1004: 'reserved',
  16. 1005: 'reserved for extensions',
  17. 1006: 'reserved for extensions',
  18. 1007: 'inconsistent or invalid data',
  19. 1008: 'policy violation',
  20. 1009: 'message too big',
  21. 1010: 'extension handshake missing',
  22. 1011: 'an unexpected condition prevented the request from being fulfilled',
  23. };