System.Net.WebSockets.WebSocketProtocol 5.1.0

About

Provides the WebSocketProtocol class, which allows creating a WebSocket from a connected stream using WebSocketsProtocol.CreateFromConnectedStream.

NOTE: This package was designed as a temporary solution for internal use (building ASP.NET targeting .NET Standard 2.0), and is now considered obsolete. If targeting .NET Standard 2.1 or .NET 5+, use WebSocket.CreateFromStream instead.

Key Features

  • Creates a new WebSocket instance that operates on the specified transport stream. The WebSocket class allows applications to send and receive data after the WebSocket upgrade has completed.
  • The API can be used to create both client-side and server-side WebSocket instances.

How to Use

To create a WebSocket using WebSocketProtocol, as a prerequisite, you need to prepare the opaque transport stream for the WebSocket, for example, create or accept a TCP socket connection as a Stream and perform a WebSocket opening handshake (upgrade) over it. Then you can use the transport stream and the negotiated subprotocol to call WebSocketProtocol.CreateFromStream.

Stream opaqueTransport = /* ... */; // complete WebSocket opening handshake over the transport connection
WebSocket ws = WebSocketProtocol.CreateFromStream(opaqueTransport, isServer: true, subProtocol, keepAliveInterval);

Remarks

The API is considered obsolete and is not recommented for use.

On .NET Framework or .NET Standard 2.0:

On .NET Core 2.1+, .NET 5+ or .NET Standard 2.1:

Main Types

The main types provided by this library are:

  • System.Net.WebSockets.WebSocketProtocol

Additional Documentation

License

System.Net.WebSockets.WebSocketProtocol is released as open source under the MIT license.

Showing the top 20 packages that depend on System.Net.WebSockets.WebSocketProtocol.

Packages Downloads
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers.
4
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers. This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/ce8cf65589734f82b0536c543aba5bd60d0a5a98
4
Microsoft.AspNetCore.All
Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
4
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers. This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/0f9ad16b096ca2535d77efd2ad27645449421b44
3
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers.
3
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers. This package was built from the source at: https://github.com/aspnet/WebSockets/tree/6d565e3a8a6ab74d27ce2e1bbc64e58ad242cd99
3
Microsoft.AspNetCore.All
Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
3
Microsoft.AspNetCore.Http.Connections
Components for providing real-time bi-directional communication across the Web.
2
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers.
2
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers. This package was built from the source at: https://github.com/aspnet/WebSockets/tree/56f90124026b1da5f260b3c1a55f75fab7ecbb68
2
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers. This package was built from the source at: https://github.com/aspnet/WebSockets/tree/ecadd7b7b1378f8722b868335cca0161e935d2ff
2
Microsoft.AspNetCore.Http.Connections
Components for providing real-time bi-directional communication across the Web.
1

Version Downloads Last updated
6.0.0-preview.1.21102.12 4 10/06/2024
5.1.0 1 11/25/2024
5.0.0 2 11/25/2024
5.0.0-rc.2.20475.5 3 10/06/2024
5.0.0-rc.1.20451.14 3 10/06/2024
5.0.0-preview.8.20407.11 3 10/06/2024
5.0.0-preview.7.20364.11 3 11/25/2024
5.0.0-preview.6.20305.6 4 10/06/2024
5.0.0-preview.5.20278.1 4 10/06/2024
5.0.0-preview.4.20251.6 3 10/06/2024
5.0.0-preview.3.20214.6 3 10/06/2024
5.0.0-preview.2.20160.6 3 10/06/2024
5.0.0-preview.1.20120.5 2 11/25/2024
4.7.1 3 10/06/2024
4.7.0 3 10/06/2024
4.7.0-preview3.19551.4 3 10/06/2024
4.7.0-preview2.19523.17 4 10/06/2024
4.7.0-preview1.19504.10 3 11/25/2024
4.6.0 4 10/06/2024
4.6.0-rc1.19456.4 3 10/06/2024
4.6.0-preview9.19421.4 2 10/31/2024
4.6.0-preview9.19416.11 3 10/06/2024
4.6.0-preview8.19405.3 3 11/25/2024
4.6.0-preview7.19362.9 3 10/06/2024
4.6.0-preview6.19303.8 3 10/06/2024
4.6.0-preview6.19264.9 3 10/06/2024
4.6.0-preview5.19224.8 2 10/06/2024
4.6.0-preview4.19212.13 3 11/25/2024
4.6.0-preview3.19128.7 3 10/06/2024
4.6.0-preview.19073.11 3 10/06/2024
4.6.0-preview.18571.3 3 10/06/2024
4.5.3 4 10/06/2024
4.5.2 4 10/06/2024
4.5.1 3 11/23/2022
4.5.0 3 04/04/2022
4.5.0-rc1 3 10/06/2024
4.5.0-preview2-26406-04 3 10/06/2024
4.5.0-preview1-26216-02 2 11/25/2024