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