TurboVNC / turbovnc

Main TurboVNC repository
https://TurboVNC.org
GNU General Public License v2.0
747 stars 137 forks source link

webassembly module #333

Closed OverdueCEO closed 2 years ago

OverdueCEO commented 2 years ago

Hello, I was thinking about compiling turbovnc to webassembly module (using emscripten) to be able to run it inside a browser. I was wondering whether it is even possible after reading:

I have funding for research into a WebAssembly TurboVNC Viewer, but currently that technology has fundamental issues that prevent it from working with a VNC viewer

in this issue. Does it make a sense if I try or it would be just pointless waste of time ?

dcommander commented 2 years ago

I did some preliminary work on this a few years ago for a former client. I was able to compile libjpeg-turbo without SIMD. (SIMD support in WebAssembly was still a work in progress at the time. Not sure what the current status is.) Then I tried to get a simple VNC viewer running from the LibVNCServer examples. I built it successfully, but it never worked. As near as I can determine, the reason is that WebAssembly does not faithfully emulate sockets. I seem to recall that either WASM sockets are always asynchronous and TurboVNC needed synchronous behavior or vice versa.

dcommander commented 2 years ago

In short, it may be possible, but not with TurboVNC as is. Also, the current TurboVNC Viewer is written in Java, so I doubt it could be compiled using WASM. Even if you could compile the guts of the viewer using WASM, the GUI code would have to be rewritten to accommodate it.