Thanks for your efforts making this library @jirihybek. I've made an alternative to this, highly based on yours, using System.Net.WebSockets instead of WebSocketSharp.
It is available here: https://github.com/endel/UnityWebSockets
I hope it will be useful for the community!