unity-websocket-server icon indicating copy to clipboard operation
unity-websocket-server copied to clipboard

Don't implement WebSocket Protocol from scratch

Open phantomcosmonaut opened this issue 2 years ago • 1 comments

There is no need to maintain code that implements the websocket protocol. Just wrap the TcpClient stream with a factory method from the System library System.Net.Sockets.WebSocket.CreateFromStream(client.GetStream(), true, null, TimeSpan.FromSeconds(n)) and you get all the functionality for free.

phantomcosmonaut avatar Jan 14 '23 21:01 phantomcosmonaut

you still need the negotiation step, but saves you from having to read and write data frames

phantomcosmonaut avatar Jan 14 '23 21:01 phantomcosmonaut