|
1 | 1 | # ws
|
2 | 2 |
|
| 3 | +## Table of Contents |
| 4 | + |
| 5 | +- [Class: WebSocket.Server](#class-websocketserver) |
| 6 | + - [new WebSocket.Server(options[, callback])](#new-websocketserveroptions-callback) |
| 7 | + - [Event: 'close'](#event-close) |
| 8 | + - [Event: 'connection'](#event-connection) |
| 9 | + - [Event: 'error'](#event-error) |
| 10 | + - [Event: 'headers'](#event-headers) |
| 11 | + - [Event: 'listening'](#event-listening) |
| 12 | + - [server.address()](#serveraddress) |
| 13 | + - [server.clients](#serverclients) |
| 14 | + - [server.close([callback])](#serverclosecallback) |
| 15 | + - [server.handleUpgrade(request, socket, head, callback)](#serverhandleupgraderequest-socket-head-callback) |
| 16 | + - [server.shouldHandle(request)](#servershouldhandlerequest) |
| 17 | +- [Class: WebSocket](#class-websocket) |
| 18 | + - [Ready state constants](#ready-state-constants) |
| 19 | + - [new WebSocket(address[, protocols][, options])](#new-websocketaddress-protocols-options) |
| 20 | + - [UNIX Domain Sockets](#unix-domain-sockets) |
| 21 | + - [Event: 'close'](#event-close-1) |
| 22 | + - [Event: 'error'](#event-error-1) |
| 23 | + - [Event: 'message'](#event-message) |
| 24 | + - [Event: 'open'](#event-open) |
| 25 | + - [Event: 'ping'](#event-ping) |
| 26 | + - [Event: 'pong'](#event-pong) |
| 27 | + - [Event: 'unexpected-response'](#event-unexpected-response) |
| 28 | + - [Event: 'upgrade'](#event-upgrade) |
| 29 | + - [websocket.addEventListener(type, listener)](#websocketaddeventlistenertype-listener) |
| 30 | + - [websocket.binaryType](#websocketbinarytype) |
| 31 | + - [websocket.bufferedAmount](#websocketbufferedamount) |
| 32 | + - [websocket.close([code[, reason]])](#websocketclosecode-reason) |
| 33 | + - [websocket.extensions](#websocketextensions) |
| 34 | + - [websocket.onclose](#websocketonclose) |
| 35 | + - [websocket.onerror](#websocketonerror) |
| 36 | + - [websocket.onmessage](#websocketonmessage) |
| 37 | + - [websocket.onopen](#websocketonopen) |
| 38 | + - [websocket.ping([data[, mask]][, callback])](#websocketpingdata-mask-callback) |
| 39 | + - [websocket.pong([data[, mask]][, callback])](#websocketpongdata-mask-callback) |
| 40 | + - [websocket.protocol](#websocketprotocol) |
| 41 | + - [websocket.readyState](#websocketreadystate) |
| 42 | + - [websocket.removeEventListener(type, listener)](#websocketremoveeventlistenertype-listener) |
| 43 | + - [websocket.send(data[, options][, callback])](#websocketsenddata-options-callback) |
| 44 | + - [websocket.terminate()](#websocketterminate) |
| 45 | + - [websocket.url](#websocketurl) |
| 46 | + |
3 | 47 | ## Class: WebSocket.Server
|
4 | 48 |
|
5 | 49 | This class represents a WebSocket server. It extends the `EventEmitter`.
|
@@ -129,20 +173,20 @@ handshake. This allows you to inspect/modify the headers before they are sent.
|
129 | 173 |
|
130 | 174 | Emitted when the underlying server has been bound.
|
131 | 175 |
|
132 |
| -### server.clients |
133 |
| - |
134 |
| -- {Set} |
135 |
| - |
136 |
| -A set that stores all connected clients. Please note that this property is only |
137 |
| -added when the `clientTracking` is truthy. |
138 |
| - |
139 | 176 | ### server.address()
|
140 | 177 |
|
141 | 178 | Returns an object with `port`, `family`, and `address` properties specifying the
|
142 | 179 | bound address, the address family name, and port of the server as reported by
|
143 | 180 | the operating system if listening on an IP socket. If the server is listening on
|
144 | 181 | a pipe or UNIX domain socket, the name is returned as a string.
|
145 | 182 |
|
| 183 | +### server.clients |
| 184 | + |
| 185 | +- {Set} |
| 186 | + |
| 187 | +A set that stores all connected clients. Please note that this property is only |
| 188 | +added when the `clientTracking` is truthy. |
| 189 | + |
146 | 190 | ### server.close([callback])
|
147 | 191 |
|
148 | 192 | Close the HTTP server if created internally, terminate all clients and call
|
|
0 commit comments