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.
59
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers.
54
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
53
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
48
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers.
47
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
45
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
44
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers.
44
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
41
Microsoft.AspNetCore.WebSockets
ASP.NET Core web socket middleware for use on top of opaque servers.
41

Version Downloads Last updated
6.0.0-preview.1.21102.12 62 9/5/2022
5.1.0 12 11/19/2024
5.0.0 37 9/15/2022
5.0.0-rc.2.20475.5 46 9/15/2022
5.0.0-rc.1.20451.14 40 9/15/2022
5.0.0-preview.8.20407.11 38 8/3/2022
5.0.0-preview.7.20364.11 37 9/15/2022
5.0.0-preview.6.20305.6 38 9/15/2022
5.0.0-preview.5.20278.1 50 9/15/2022
5.0.0-preview.4.20251.6 40 9/15/2022
5.0.0-preview.3.20214.6 47 9/15/2022
5.0.0-preview.2.20160.6 46 9/15/2022
5.0.0-preview.1.20120.5 43 9/15/2022
4.7.1 46 8/5/2022
4.7.0 39 9/15/2022
4.7.0-preview3.19551.4 38 9/15/2022
4.7.0-preview2.19523.17 42 9/15/2022
4.7.0-preview1.19504.10 44 9/15/2022
4.6.0 41 9/15/2022
4.6.0-rc1.19456.4 44 9/15/2022
4.6.0-preview9.19421.4 54 8/3/2022
4.6.0-preview9.19416.11 35 9/15/2022
4.6.0-preview8.19405.3 34 9/15/2022
4.6.0-preview7.19362.9 47 9/15/2022
4.6.0-preview6.19303.8 41 9/15/2022
4.6.0-preview6.19264.9 43 9/15/2022
4.6.0-preview5.19224.8 42 9/12/2022
4.6.0-preview4.19212.13 60 9/15/2022
4.6.0-preview3.19128.7 48 9/15/2022
4.6.0-preview.19073.11 46 9/15/2022
4.6.0-preview.18571.3 38 9/15/2022
4.5.3 33 9/15/2022
4.5.2 42 9/5/2022
4.5.1 49 9/15/2022
4.5.0 45 9/15/2022
4.5.0-rc1 40 9/15/2022
4.5.0-preview2-26406-04 42 9/15/2022
4.5.0-preview1-26216-02 44 9/15/2022