Skip to content

Commit

Permalink
enabled mask for websocket encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryjiang committed Aug 31, 2024
1 parent b981bf9 commit 8ea37e1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<SuperSocketVersion>2.0.0-beta.24</SuperSocketVersion>
<SuperSocketVersion>2.0.0-beta.26</SuperSocketVersion>
</PropertyGroup>
</Project>
5 changes: 5 additions & 0 deletions src/WebSocket4Net/HandshakePipelineFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ namespace WebSocket4Net
{
internal class HandshakePipelineFilter : WebSocketPipelineFilter
{
public HandshakePipelineFilter()
: base(requireMask: false)
{
}

protected override HttpHeader CreateHttpHeader(string verbItem1, string verbItem2, string verbItem3, NameValueCollection items)
{
return HttpHeader.CreateForResponse(verbItem1, verbItem2, verbItem3, items);
Expand Down
10 changes: 9 additions & 1 deletion src/WebSocket4Net/WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ public class WebSocket : EasyClient<WebSocketPackage>, IWebSocket

private readonly EndPoint _remoteEndPoint;

private static readonly IPackageEncoder<WebSocketPackage> _packageEncoder = new WebSocketEncoder();
private static readonly IPackageEncoder<WebSocketPackage> _packageEncoder = new WebSocketMaskedEncoder(ArrayPool<byte>.Shared, new int[]
{
1024,
1024 * 4,
1024 * 8,
1024 * 16,
1024 * 32,
1024 * 64
});

private List<string> _subProtocols;

Expand Down

0 comments on commit 8ea37e1

Please sign in to comment.