Class WebSocketMessage
A WebSocketMessage stores a single frame of a single WebSocket message http://tools.ietf.org/html/rfc6455
Inheritance
Namespace: Fiddler
Assembly: FiddlerCore.dll
Syntax
public class WebSocketMessage : Object
Constructors
WebSocketMessage(Byte[], Boolean, DateTime, Int32, Int32)
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
System. The payload data as byte array |
System. Message sent by the client |
System. Message received time |
System. Websocket frame type |
System. Websocket message id |
Fields
Timers
The WebSocketTimers collection tracks the timestamps for this message
Declaration
public WebSocketTimers Timers
Field Value
Properties
FrameType
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
System.
|
ID
Declaration
public int ID { get; }
Property Value
System.
|
IsFinalFrame
Declaration
public bool IsFinalFrame { get; }
Property Value
System.
|
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
System.
|
MaskingKey
Declaration
[CodeDescription("Returns the WebSocketMessage's masking key, if any.")]
public byte[] MaskingKey { get; }
Property Value
System.
|
PayloadData
Declaration
[CodeDescription("Returns the raw payload data, which may be masked.")]
public byte[] PayloadData { get; }
Property Value
System.
|
PayloadLength
Declaration
public int PayloadLength { get; }
Property Value
System.
|
WasAborted
Declaration
[CodeDescription("Indicates whether this WebSocketMessage was aborted.")]
public bool WasAborted { get; }
Property Value
System.
|
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
System. A new byte array containing the (unmasked) payload. |
PayloadAsString(Boolean)
Return the WebSocketMessage's payload as a string.
Declaration
[CodeDescription("Returns the WebSocketMessage's payload as a string, unmasking if needed.")]
public string PayloadAsString(bool forceText = false)
Parameters
System. Force decoding the message data as text even if message type is binary |
Returns
System.
|
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
System.
|
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
System.
|
ToByteArray()
Declaration
[CodeDescription("Returns the entire WebSocketMessage, including headers.")]
public byte[] ToByteArray()
Returns
System.
|
ToString()
Declaration
[CodeDescription("Returns all info about this message.")]
public override string ToString()
Returns
System.
|