Recommend this page to a friend! |
Classes of Igor Escobar | Terminal Crossword | chat-websocket/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/doc/ws.md | Download |
|
|
DownloadwsClass: ws.ServerThis class is a WebSocket server. It is an new ws.Server([options], [callback])
Construct a new server object. Either server.close([code], [data])Close the server and terminate all clients server.handleUpgrade(request, socket, upgradeHead, callback)Handles a HTTP Upgrade request. When the Upgrade was successfully, the Event: 'error'
If the underlying server emits an error, it will be forwarded here. Event: 'headers'
Emitted with the object of HTTP headers that are going to be written to the Event: 'connection'
When a new WebSocket connection is established. Class: ws.WebSocketThis class represents a WebSocket connection. It is an new ws.WebSocket(address, [options])Instantiating with an websocket.bytesReceivedReceived bytes count. websocket.readyStatePossible states are websocket.protocolVersionThe WebSocket protocol version used for this connection, websocket.urlThe URL of the WebSocket server (only for clients) websocket.supportsDescribes the feature of the used protocol version. E.g. websocket.close([code], [data])Gracefully closes the connection, after sending a description message websocket.pause()Pause the client stream websocket.ping([data], [options], [dontFailWhenClosed])Sends a ping. websocket.pong([data], [options], [dontFailWhenClosed])Sends a pong. websocket.resume()Resume the client stream websocket.send(data, [options], [callback])Sends websocket.stream([options], callback)Streams data through calls to a user supplied function. websocket.terminate()Immediately shuts down the connection websocket.onopenwebsocket.onerrorwebsocket.onclosewebsocket.onmessageEmulates the W3C Browser based WebSocket interface using function members. websocket.addEventListener(method, listener)Emulates the W3C Browser based WebSocket interface using addEventListener. Event: 'error'
If the client emits an error, this event is emitted (errors from the underlying Event: 'close'
Is emitted when the connection is closed. The Event: 'message'
Is emitted when data is received. Event: 'ping'
Is emitted when a ping is received. Event: 'pong'
Is emitted when a pong is received. Event: 'open'
Emitted when the connection is established. |