@@ -64,23 +64,23 @@ This class represents a WebSocket server. It extends the `EventEmitter`.
6464### new WebSocketServer(options[ , callback] )
6565
6666- ` options ` {Object}
67- - ` host ` {String} The hostname where to bind the server.
68- - ` port ` {Number} The port where to bind the server.
6967 - ` 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.
7469 - ` handleProtocols ` {Function} A function which can be used to handle the
7570 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.
7773 - ` 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 .
7975 - ` 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.
8178 - ` skipUTF8Validation ` {Boolean} Specifies whether or not to skip UTF-8
8279 validation for text and close messages. Defaults to ` false ` . Set to ` true `
8380 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 ) )
8484- ` callback ` {Function}
8585
8686Create 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`.
269269 ` false ` .
270270 - ` handshakeTimeout ` {Number} Timeout in milliseconds for the handshake
271271 request. This is reset after every redirection.
272+ - ` maxPayload ` {Number} The maximum allowed message size in bytes.
272273 - ` maxRedirects ` {Number} The maximum number of redirects allowed. Defaults
273274 to 10.
274- - ` perMessageDeflate ` {Boolean|Object} Enable/disable permessage-deflate.
275- - ` protocolVersion ` {Number} Value of the ` Sec-WebSocket-Version ` header.
276275 - ` origin ` {String} Value of the ` Origin ` or ` Sec-WebSocket-Origin ` header
277276 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.
279279 - ` skipUTF8Validation ` {Boolean} Specifies whether or not to skip UTF-8
280280 validation for text and close messages. Defaults to ` false ` . Set to ` true `
281281 only if the server is trusted.
@@ -491,14 +491,14 @@ only removes listeners added with
491491- ` data ` {Array|Number|Object|String|ArrayBuffer|Buffer|DataView|TypedArray} The
492492 data to send.
493493- ` options ` {Object}
494- - ` compress ` {Boolean} Specifies whether ` data ` should be compressed or not.
495- Defaults to ` true ` when permessage-deflate is enabled.
496494 - ` binary ` {Boolean} Specifies whether ` data ` should be sent as a binary or
497495 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 .
500498 - ` fin ` {Boolean} Specifies whether ` data ` is the last fragment of a message
501499 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.
502502- ` callback ` {Function} An optional callback which is invoked when ` data ` is
503503 written out.
504504
0 commit comments