Add a HTML5 client for the remote desktop protocol.

It is implemented using websockets and canvas darwing. It directly
speaks the remote desktop protocol. A websocket proxy that translates
the TCP connection into a usable form is needed. Websockify works for
this out of the box directly under Haiku.

Note that not all drawing modes are implemented, and most of them don't
have a good match on the canvas side. Fonts are also not properly
supported yet. A sans serif font will be used on the client for
everything and the metrics between the client and server will diverge
and cause drawing artifacts.

Usage:

* Run an application with a target screen to create the desktop:

	TARGET_SCREEN=5001 Terminal

* Use a websocket proxy to expose the port via websockets:

	websockify.py 5000 localhost:5001

* Open HaikuRemoteDesktop.html in a browser and connect.

To get the full desktop experience you may want to run Tracker and
Deskbar inside the virtual desktop. As they are both single launch
and controlled by the launch_daemon, you have to stop them via:

	launch_roster stop x-vnd.be-trak
	launch_roster stop x-vnd.be-tskb

And then start them manually from within the virtual desktop:

	/system/Tracker &
	/system/Deskbar &
This commit is contained in:
Michael Lotz 2017-11-21 21:51:39 +01:00
parent 778469156a
commit 85195eb807
2 changed files with 2317 additions and 0 deletions

View File

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<title>Haiku Remote Desktop</title>
<script src="HaikuRemoteDesktop.js"></script>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
height: 100%;
}
body, #connectForm {
display: flex;
}
body {
font-family: sans;
align-items: flex-start;
justify-content: center;
}
#connectForm {
flex-direction: column;
align-items: flex-start;
}
#connectForm div {
display: flex;
justify-content: space-between;
align-items: baseline;
width: 100%;
}
input, button {
margin: 1em;
}
input[type=number] {
width: 5em;
}
button {
align-self: flex-end;
}
.session {
display: none;
}
body.connect .session {
display: initial;
}
body.connect #connectForm {
display: none;
}
</style>
</head>
<body onload="init();">
<div id="connectForm">
<div>
<label for="targetAddress">Remote Host</label>
<input type="text" id="targetAddress"
value="ws://localhost:5000" />
</div>
<div>
<label for="width">Width</label>
<input type="number" id="width" value="800" />
<label for="height">Height</label>
<input type="number" id="height" value="600" />
</div>
<button id="connectButton" autofocus>Connect</button>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff