deniszykov / WebSocketListener

A lightweight and highly scalable asynchronous WebSocket listener
http://vtortola.github.io/WebSocketListener
81 stars 17 forks source link

Use WebSocketDeflateExtension in WebSocketClient #30

Closed ngyukman closed 4 years ago

ngyukman commented 6 years ago

hi, thanks for the nice library, right now I have problem when enabling Deflate in WebSocketClient

var options = new WebSocketListenerOptions();

options.Standards.RegisterRfc6455(standard => standard.MessageExtensions.Add(new WebSocketDeflateExtension()));
var client = new WebSocketClient(options);
await client.ConnectAsync(uri, CancellationToken.None);

I have tried the above code to see if the client could enable the permessage-deflate but it fails to connect and returns 400 Bad Request, am I missing something to enable it in WebSocketClient?

deniszykov commented 6 years ago

Hi @ngyukman! Actually there is no extension negotiation in WebSocketClient, I forgot it ;) Implementation will took some time.

ngyukman commented 6 years ago

thanks!

I think it should be enabled by default and let the server to decide if compression is enabled or not

deniszykov commented 4 years ago

I have added extension negotiation in WebSocketClient! 🥳