SharpLink icon indicating copy to clipboard operation
SharpLink copied to clipboard

WebSocket fails on .NETFramework

Open NovusTheory opened this issue 7 years ago • 2 comments

As per how ClientWebSocket works in .NETFramework (Microsoft's problem) the WebSocket fails to connect properly or at least will throw an exception saying the "Connection" header is invalid because Lavalink is sending Upgrade,Keep-Alive and Microsoft programmed it to only allow a connection header equal to Upgrade.

Workaround / Likely only fix => Create custom WebSocket class. EDIT: WebSocket4Net usage works too

NovusTheory avatar Jun 20 '18 16:06 NovusTheory

This also seems to fix the issue its a modified websocket based on the original websocket class so all you have to do it replace clientwebsocket with this class and it works. https://github.com/PingmanTools/System.Net.WebSockets.Client.Managed

xXBuilderBXx avatar Jul 15 '18 01:07 xXBuilderBXx

Thank you for that @xXBuilderBXx. I will look into this!

NovusTheory avatar Jul 15 '18 17:07 NovusTheory