Dear ImGui over WebSockets

I’ve been making some progress with streaming ImDrawData to WebSocket clients in order to achieve remote viewing/control of applications using Dear ImGui. Wanted to share some of the progress and ideas, in case other people are also interested in this. The repo is available here.

Here is an overview of the project:

  • I am using the uWebSockets library to create a HTTP/WebSocket server within the application. The library is small and multi-platform and so far is doing a good job

  • The “example_null” from the Dear ImGui repo was a great starting point for experiments because is allows to create Dear ImGui context and generate draw data even without linking OpenGL or creating an application window. Effectively, it allows to create applications running on a remote headless server that stream their GUI to browser clients. I find this very convenient as it can be used to quickly create UIs for various server tasks and I guess it could potentially find applications in game development

  • I rented a Linode server instance and started 2 examples with which people can play with remotely (links are available in the repo)

  • The main challenge is compressing the differences between the ImDrawData buffers in consecutive frames in a smart way in order to reduce network traffic. There were various good ideas in Dear ImGui’s Github issues that I am planning to continue to explore

  • I wanted to make sort of a framework that allows to compare the performance of the various compression strategies, so in that regard, I made several tools that can be used to store/replay Dear ImGui sessions. This way I can run the compression algorithms on the same datasets and compare the results

If anyone has ideas for compression strategies, examples or any kind of feedback - will be happy to hear!

Hello Georgi,
Thanks for posting this. Don’t hesitate to post more in the existing github thread (https://github.com/ocornut/imgui/issues/75) or to create your own thread there, I think your project is worth getting increased visibility. I added a link to it from the wiki and I will link to it in the next release note if you don’t mind!
-Omar

Hi Omar,

Thanks for the feedback and for adding the wiki link!
Will make sure to post updates in #75 with additional interesting progress.

Best regards,
Georgi

1 Like