-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
44 lines (39 loc) · 2.09 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
exports.State = {
"Closed": 0,
"Connecting": 1,
"Connected": 2,
"Closing": 3,
"ClosingError": 4
};
exports.FrameType = {
"Continuation": 0x0,
"Data": {
"Text": 0x1,
"Binary": 0x2
},
"Control": {
"Close": 0x8,
"Ping": 0x9,
"Pong": 0xA
}
};
exports.StatusCode = {
"NormalClosure": 1000, /** Graceful disconnection */
"EndpointGoingAway": 1001, /** Closing connection because either the server or the client is going down (e.g. browser navigating away) */
"ProtocolError": 1002, /** Either side is terminating the connection due to a protocol error */
"UnacceptableDataType": 1003, /** Terminating because either side received data that it can't accept or process */
//"Reserved1": 1004, /** Reserved. Do not use. */
"NoStatusCode": 1005, /** MUST NOT be sent over the wire. Used internally when no status code was sent. */
"AbnormalTermination": 1006, /** MUST NOT be sent over the wire. Used internally when the connection is closed without sending/receiving a Close frame. */
"InconsistentData": 1007, /** Terminating because either side received data that wasn't consistent with the expected type */
"PolicyViolation": 1008, /** Generic. Terminating because either side received a message that violated its policy */
"MessageTooBig": 1009, /** Terminating because either side received a message that is too big to process */
"MissingExtension": 1010, /** Client is terminating because the server didn't negotiate one or more extensions that we require */
"UnexpectedCondition": 1011, /** Server is terminating because it encountered an unexpected condition that prevented it from fulfilling the request */
"ServiceRestart": 1012, /** Server is terminating because it is restarting. */
"TryAgainLater": 1013, /** Server is terminating because of some temporary condition, e.g. it is overloaded. */
//"Reserved2": 1014, /** Reserved. Do not use. */
"TLSFailed": 1015 /** MUST NOT be sent over the wire. Used internally when TLS handshake fails. */
};
require('./client.js');
require('./server.js');