quamotion / remoteviewing

RemoteViewing is a .NET-native VNC client and server library.
Other
261 stars 79 forks source link

VNC Client doesn't work on Blazor Web Assembly (Socket not avaible in the browser) #142

Closed simone-devoti closed 2 years ago

simone-devoti commented 2 years ago

In a Blazor Web Assembly net5.0 project

When calling the method: public void Connect(string hostname, int port = 5900, VncClientConnectOptions options = null); From the class RemoteViewing.Vnc.VncClient

It throws the exception: System.PlatformNotSupportedException: System.Net.Sockets is not supported on this platform. image

Because Sockets are not supported in a web browser

Is there any way to connect to a VNC server using this library? I am thinking of using the following method: public void Connect(Stream stream, VncClientConnectOptions options = null);

qmfrederik commented 2 years ago

If you want to get a VNC client in a browser, you may want to have a look at noVNC. If you can't have direct socket connections, consider tunneling your VNC connection over a websocket (like noVNC's websockify does). If you can get a Stream off a WebSocket, you could pass that to Connect. But it's wildly out of scope for this repository ;-).

simone-devoti commented 2 years ago

@qmfrederik Thanks for the response!

I will look into noVNC

I also think that if instead of a Blazor web assembly i use Blazor server the vnc connection should work fine