@@ -64,23 +64,23 @@ This class represents a WebSocket server. It extends the `EventEmitter`.
64
64
### new WebSocketServer(options[ , callback] )
65
65
66
66
- ` options ` {Object}
67
- - ` host ` {String} The hostname where to bind the server.
68
- - ` port ` {Number} The port where to bind the server.
69
67
- ` backlog ` {Number} The maximum length of the queue of pending connections.
70
- - ` server ` {http.Server|https.Server} A pre-created Node.js HTTP/S server.
71
- - ` verifyClient ` {Function} A function which can be used to validate incoming
72
- connections. See description below. (Usage is discouraged: see
73
- [ Issue #337 ] ( https://github.com/websockets/ws/issues/377#issuecomment-462152231 ) )
68
+ - ` clientTracking ` {Boolean} Specifies whether or not to track clients.
74
69
- ` handleProtocols ` {Function} A function which can be used to handle the
75
70
WebSocket subprotocols. See description below.
76
- - ` path ` {String} Accept only connections matching this path.
71
+ - ` host ` {String} The hostname where to bind the server.
72
+ - ` maxPayload ` {Number} The maximum allowed message size in bytes.
77
73
- ` noServer ` {Boolean} Enable no server mode.
78
- - ` clientTracking ` {Boolean} Specifies whether or not to track clients .
74
+ - ` path ` {String} Accept only connections matching this path .
79
75
- ` perMessageDeflate ` {Boolean|Object} Enable/disable permessage-deflate.
80
- - ` maxPayload ` {Number} The maximum allowed message size in bytes.
76
+ - ` port ` {Number} The port where to bind the server.
77
+ - ` server ` {http.Server|https.Server} A pre-created Node.js HTTP/S server.
81
78
- ` skipUTF8Validation ` {Boolean} Specifies whether or not to skip UTF-8
82
79
validation for text and close messages. Defaults to ` false ` . Set to ` true `
83
80
only if clients are trusted.
81
+ - ` verifyClient ` {Function} A function which can be used to validate incoming
82
+ connections. See description below. (Usage is discouraged: see
83
+ [ Issue #337 ] ( https://github.com/websockets/ws/issues/377#issuecomment-462152231 ) )
84
84
- ` callback ` {Function}
85
85
86
86
Create a new server instance. One and only one of ` port ` , ` server ` or ` noServer `
@@ -269,13 +269,13 @@ This class represents a WebSocket. It extends the `EventEmitter`.
269
269
` false ` .
270
270
- ` handshakeTimeout ` {Number} Timeout in milliseconds for the handshake
271
271
request. This is reset after every redirection.
272
+ - ` maxPayload ` {Number} The maximum allowed message size in bytes.
272
273
- ` maxRedirects ` {Number} The maximum number of redirects allowed. Defaults
273
274
to 10.
274
- - ` perMessageDeflate ` {Boolean|Object} Enable/disable permessage-deflate.
275
- - ` protocolVersion ` {Number} Value of the ` Sec-WebSocket-Version ` header.
276
275
- ` origin ` {String} Value of the ` Origin ` or ` Sec-WebSocket-Origin ` header
277
276
depending on the ` protocolVersion ` .
278
- - ` maxPayload ` {Number} The maximum allowed message size in bytes.
277
+ - ` perMessageDeflate ` {Boolean|Object} Enable/disable permessage-deflate.
278
+ - ` protocolVersion ` {Number} Value of the ` Sec-WebSocket-Version ` header.
279
279
- ` skipUTF8Validation ` {Boolean} Specifies whether or not to skip UTF-8
280
280
validation for text and close messages. Defaults to ` false ` . Set to ` true `
281
281
only if the server is trusted.
@@ -491,14 +491,14 @@ only removes listeners added with
491
491
- ` data ` {Array|Number|Object|String|ArrayBuffer|Buffer|DataView|TypedArray} The
492
492
data to send.
493
493
- ` options ` {Object}
494
- - ` compress ` {Boolean} Specifies whether ` data ` should be compressed or not.
495
- Defaults to ` true ` when permessage-deflate is enabled.
496
494
- ` binary ` {Boolean} Specifies whether ` data ` should be sent as a binary or
497
495
not. Default is autodetected.
498
- - ` mask ` {Boolean} Specifies whether ` data ` should be masked or not. Defaults
499
- to ` true ` when ` websocket ` is not a server client .
496
+ - ` compress ` {Boolean} Specifies whether ` data ` should be compressed or not.
497
+ Defaults to ` true ` when permessage-deflate is enabled .
500
498
- ` fin ` {Boolean} Specifies whether ` data ` is the last fragment of a message
501
499
or not. Defaults to ` true ` .
500
+ - ` mask ` {Boolean} Specifies whether ` data ` should be masked or not. Defaults
501
+ to ` true ` when ` websocket ` is not a server client.
502
502
- ` callback ` {Function} An optional callback which is invoked when ` data ` is
503
503
written out.
504
504
0 commit comments