ClassWebSocketMessage
A WebSocketMessage stores a single frame of a single WebSocket message http://tools.ietf.org/html/rfc6455
Definition
Namespace:Fiddler
Assembly:FiddlerCore.dll
Syntax:
public class WebSocketMessage
Inheritance: objectWebSocketMessage
Inherited Members
Constructors
WebSocketMessage(byte[], bool, DateTime, int, int)
Creates a WebSocket message. Used when importing message from a HAR file.
Declaration
public WebSocketMessage(byte[] payload, bool isOutBound, DateTime time, int opcode, int id)
Parameters
payload
byte[]
The payload data as byte array
isOutBound
Message sent by the client
time
Message received time
opcode
Websocket frame type
id
Websocket message id
Fields
Timers
The WebSocketTimers collection tracks the timestamps for this message
Properties
FrameType
Declaration
public WebSocketFrameTypes FrameType { get; }
Property Value
IsOutbound
Declaration
[CodeDescription("Returns TRUE if this is a Client->Server message, FALSE if this is a message from Server->Client.")]
public bool IsOutbound { get; }
Property Value
MaskingKey
Declaration
[CodeDescription("Returns the WebSocketMessage's masking key, if any.")]
public byte[] MaskingKey { get; }
Property Value
byte[]
PayloadData
Declaration
[CodeDescription("Returns the raw payload data, which may be masked.")]
public byte[] PayloadData { get; }
Property Value
byte[]
WasAborted
Declaration
[CodeDescription("Indicates whether this WebSocketMessage was aborted.")]
public bool WasAborted { get; }
Property Value
iCloseReason
If this is a Close frame, returns the close code. Otherwise, returns -1
Declaration
[CodeDescription("If this is a Close frame, returns the close code. Otherwise, returns -1.")]
public int iCloseReason { get; }
Property Value
Methods
Abort()
Declaration
[CodeDescription("Cancel transmission of this WebSocketMessage.")]
public void Abort()
PayloadAsBytes()
Copy the WebSocketMessage's payload into a new Byte Array.
Declaration
[CodeDescription("Returns the WebSocketMessage's payload as byte[], unmasking if needed.")]
public byte[] PayloadAsBytes()
Returns
byte[]
A new byte array containing the (unmasked) payload.
PayloadAsString(bool)
Return the WebSocketMessage's payload as a string.
SetPayload(byte[])
Copies the provided byte array over the WebSocketMessage's payload, masking if needed.
Declaration
[CodeDescription("Replaces the WebSocketMessage's payload with the specified byte array, masking if needed.")]
public void SetPayload(byte[] arrNewPayload)
Parameters
arrNewPayload
byte[]
SetPayload(string)
Replaces the WebSocketMessage's payload with the specified string, masking if needed.
Declaration
[CodeDescription("Replaces the WebSocketMessage's payload with the specified string, masking if needed.")]
public void SetPayload(string sPayload)
Parameters
sPayload
ToByteArray()
Declaration
[CodeDescription("Returns the entire WebSocketMessage, including headers.")]
public byte[] ToByteArray()
Returns
byte[]
ToString()
Declaration
[CodeDescription("Returns all info about this message.")]
public override string ToString()
Returns
Overrides