Websocket Resources are core websocket connections between a client and server.
The WebsocketResource class is returned from window.waitForResource
. It contains all properties of a Resource
in addition to an ability to subscribe to messages sent back and forth.
The Http Upgrade request used to create this Websocket.
ResourceRequest
A simulation of an HTTP response pieced together from the socket headers returned during a normal HTTP upgrade.
ResourceResponse
The Http Upgrade url.
string
The type of resource.
ResourceType=WebSocket
Was this request redirected
boolean
Invalid call. Throws an Error. To subscribe to messages, see on('message', callback)
Promise<Buffer>
WebsocketMessage
=> any)Called on each websocket message returned.
WebsocketMessage
contain:string | Buffer
- the contents of the messageserver | client
- where the message originatedPromise<void>
WebsocketMessage
=> any)Unsubscribe to messages.
Promise<void>
WebsocketMessage
=> any)Subscribe to a single websocket message
Promise<void>
WebsocketMessage
=> any)Alias for on('message', callback')
Promise<void>
WebsocketMessage
=> any)Alias for off('message', callback')
Promise<void>
Invalid call. Throws an Error. To subscribe to messages, see on('message', callback)
Promise<string>
Invalid call. Throws an Error. To subscribe to messages, see on('message', callback)
Promise<json>