• Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for ASP.NET AJAX UI for ASP.NET MVC UI for ASP.NET Core UI for Blazor UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Design
    Unite UX
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
    • jQuery
    • Angular
    • React
    • Vue
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class WebSocketMessage

A WebSocketMessage stores a single frame of a single WebSocket message http://tools.ietf.org/html/rfc6455

Inheritance
System.Object
WebSocketMessage
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.Byte[] payload

The payload data as byte array

System.Boolean isOutBound

Message sent by the client

System.DateTime time

Message received time

System.Int32 opcode

Websocket frame type

System.Int32 id

Websocket message id

Fields

Timers

The WebSocketTimers collection tracks the timestamps for this message

Declaration
public WebSocketTimers Timers
Field Value
WebSocketTimers

Properties

FrameType

Declaration
public WebSocketFrameTypes FrameType { get; }
Property Value
WebSocketFrameTypes

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.Int32

ID

Declaration
public int ID { get; }
Property Value
System.Int32

IsFinalFrame

Declaration
public bool IsFinalFrame { get; }
Property Value
System.Boolean

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.Boolean

MaskingKey

Declaration
[CodeDescription("Returns the WebSocketMessage's masking key, if any.")]
public byte[] MaskingKey { get; }
Property Value
System.Byte[]

PayloadData

Declaration
[CodeDescription("Returns the raw payload data, which may be masked.")]
public byte[] PayloadData { get; }
Property Value
System.Byte[]

PayloadLength

Declaration
public int PayloadLength { get; }
Property Value
System.Int32

WasAborted

Declaration
[CodeDescription("Indicates whether this WebSocketMessage was aborted.")]
public bool WasAborted { get; }
Property Value
System.Boolean

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.Byte[]

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.Boolean forceText

Force decoding the message data as text even if message type is binary

Returns
System.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
System.Byte[] arrNewPayload

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.String sPayload

ToByteArray()

Declaration
[CodeDescription("Returns the entire WebSocketMessage, including headers.")]
public byte[] ToByteArray()
Returns
System.Byte[]

ToString()

Declaration
[CodeDescription("Returns all info about this message.")]
public override string ToString()
Returns
System.String

Getting Started
  • Try Now
Community
  • Forums
  • Blogs
  • Feedback Portal

Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.