websocket support module
To use it:
var websocket = require('websocket');
| Type | Method and Description |
|---|---|
| const Integer | public const Integer CONTINUECONTINUECONTINUESpecifies the message type 0 of websocket, which is a continue frame. |
| const Integer | public const Integer TEXTTEXTTEXTSpecifies the message type 1 of websocket, which is a text frame. |
| const Integer | public const Integer BINARYBINARYBINARYSpecifies the message type 2 of websocket, which is a binary frame. |
| const Integer | public const Integer CLOSECLOSECLOSESpecifies the message type 8 of websocket, which means connection closed. |
| const Integer | public const Integer PINGPINGPINGSpecifies the message type 9 of websocket, which is a ping frame. |
| const Integer | public const Integer PONGPONGPONGSpecifies the message type 10 of websocket, which is a pong frame. |
| WebSocketMessage new | Message()Create one websocket message object, refer WebSocketMessage. |
| WebSocketHandler new | Handler()Create one websocket packet protocol conversion processor, refer WebSocketHandler. |
| Stream | connect(String url)Create one websocket connection, and return a completed connection Stream object. |
public const Integer CONTINUECONTINUECONTINUESpecifies the message type 0 of websocket, which is a continue frame.
public const Integer TEXTTEXTTEXTSpecifies the message type 1 of websocket, which is a text frame.
public const Integer BINARYBINARYBINARYSpecifies the message type 2 of websocket, which is a binary frame.
public const Integer CLOSECLOSECLOSESpecifies the message type 8 of websocket, which means connection closed.
public const Integer PINGPINGPINGSpecifies the message type 9 of websocket, which is a ping frame.
public const Integer PONGPONGPONGSpecifies the message type 10 of websocket, which is a pong frame.
Message()Create one websocket message object, refer WebSocketMessage.
Handler()Create one websocket packet protocol conversion processor, refer WebSocketHandler.
connect(String url)Create one websocket connection, and return a completed connection Stream object.
url Specifies the connection url,support ws:// and wss:// protocolReturn a completed connection Stream object, which can be Socket or SslSocket