Hi. I have tried to find if any websocket server solution exists, but found only info that there is only websocket client.
However, even if was so in early engine versions, now there is WebSocketNetworking plugin with a possibility to create websocket server (PixelStreaming plugin also uses a part of it for websocket server). Websocket is based on libwebsockets.
For testing purposes i did test plugin which now is posted on github, so if you searching the solution too - you can start with it.
This is a part copy of WebSocketNetworking plugin, so you not need to base on it.
This is a WebSocketNetworking plugin part of code used in custom implementation like PixelStreaming plugin does.
Another example you can look is PixelStreamingServers module of PixelStreaming plugin.