| [![NuGet Package](https://img.shields.io/nuget/v/Tesses.WebServer.Ooui.svg)](https://www.nuget.org/packages/Tesses.WebServer.Ooui) | [Ooui](https://www.nuget.org/packages/Tesses.WebServer.Ooui) | Core library with HTML elements and a server |
It presents a classic object-oriented UI API that controls a dumb browser. With Ooui, you get the full power of your favorite .NET programming language *plus* the ability to interact with your app using any device.
You can also load [https://s3.amazonaws.com/praeclarum.org/wasm/index.html](https://s3.amazonaws.com/praeclarum.org/wasm/index.html) to try the WebAssembly mode of Ooui running Xamarin.Forms. (That's Xamarin.Forms running right in your browser!)
This will open the default starting page for the Samples. Now point your browser at [http://localhost:8080/shared-button](http://localhost:8080/shared-button)
Ooui has been broken up into several packages to increase the variety of ways that it can be used. Here are some combinations to help you decide which way is best for you.
<td>✓</td><td></td><td></td><td></td><td><ahref="https://github.com/praeclarum/Ooui/wiki/Web-DOM-with-the-Built-in-Web-Server">Web DOM with the Built-in Web Server</a></td>
<td>✓</td><td></td><td></td><td>✓</td><td><ahref="https://github.com/praeclarum/Ooui/wiki/Web DOM-with-Web-Assembly">Web DOM with Web Assembly</a></td>
<td>✓</td><td></td><td>✓</td><td>✓</td><td><ahref="https://github.com/praeclarum/Ooui/wiki/Xamarin.Forms-with-Web-Assembly">Xamarin.Forms with Web Assembly</a></td>
When the user requests a page, the page will connect to the server using a web socket. This socket is used to keep the server's in-memory model of the UI (the one you work with as a programmer) in sync with the actual UI shown to the user in their browser. This is done using a simple messaging protocol with JSON packets.
In the case of web assembly, this same dataflow takes place. However, sockets are not used as all communication is done locally in the browser process.
Ooui is open source and I love merging PRs. Please fork away, and please obey the .editorconfig file. :-) Try to file issues for things that you want to work on *before* you start the work so that there's no duplicated effort. If you just want to help out, check out the issues and dive in!, please contribute to the [original](https://github.com/praeclarum/Ooui) not this port (you can fork this port if you want)
## Why I ported this library to Tesses.WebServer
Well so this would work on mono (mono to my knowledge doesn't support System.Net.WebSockets) and I would like to integrate this library into my webserver
## This still does not work with mono (returns this only on mono, in net6.0 its fine)
Failed to send queued messages, aborting session: System.AggregateException: One or more errors occurred. (Mutex is not owned) ---> System.ApplicationException: Mutex is not owned
at System.Threading.Mutex.ReleaseMutex () [0x0000d] in <de882a77e7c14f8ba5d298093dde82b2>:0
at (wrapper remoting-invoke-with-check) System.Threading.Mutex.ReleaseMutex()
at Tesses.WebServer.WebSocket.WebSocketServer.SendMessageAsync (Tesses.WebServer.WebSocket.WebSocketMessage msg) [0x001cb] in <f32f1eef98ca40a6ab8f682da2f01df7>:0
at Tesses.WebServer.WebSocketExtensions+<>c__DisplayClass2_2.<StartWebSocketConnection>b__6 () [0x00072] in <f32f1eef98ca40a6ab8f682da2f01df7>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <de882a77e7c14f8ba5d298093dde82b2>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <de882a77e7c14f8ba5d298093dde82b2>:0
at System.Threading.Tasks.Task.Wait () [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
at Tesses.WebServer.WebSocketExtensions+<>c__DisplayClass2_1.<StartWebSocketConnection>b__4 (Tesses.WebServer.WebSocket.WebSocketMessage mm) [0x00023] in <f32f1eef98ca40a6ab8f682da2f01df7>:0
at Ooui.WebSocketSession.TransmitQueuedMessages () [0x00050] in <3f1f33bf6fb4419491d2271f7e0005d9>:0
---> (Inner Exception #0) System.ApplicationException: Mutex is not owned
at System.Threading.Mutex.ReleaseMutex () [0x0000d] in <de882a77e7c14f8ba5d298093dde82b2>:0
at (wrapper remoting-invoke-with-check) System.Threading.Mutex.ReleaseMutex()
at Tesses.WebServer.WebSocket.WebSocketServer.SendMessageAsync (Tesses.WebServer.WebSocket.WebSocketMessage msg) [0x001cb] in <f32f1eef98ca40a6ab8f682da2f01df7>:0
at Tesses.WebServer.WebSocketExtensions+<>c__DisplayClass2_2.<StartWebSocketConnection>b__6 () [0x00072] in <f32f1eef98ca40a6ab8f682da2f01df7>:0 <---