Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First, primitive stab at SPiCE integration #6

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ docker:
docker build . -t gotty-bash:$(VERSION)

.PHONY: asset
asset: bindata/static/js/gotty.js bindata/static/index.html bindata/static/favicon.png bindata/static/css/index.css bindata/static/css/xterm.css bindata/static/css/xterm_customize.css bindata/static/manifest.json bindata/static/icon_192.png server/asset.go
asset: bindata/static/js/gotty.js bindata/static/js/spice.js bindata/static/index.html bindata/static/spice bindata/static/favicon.png bindata/static/css/index.css bindata/static/css/xterm.css bindata/static/css/xterm_customize.css bindata/static/manifest.json bindata/static/icon_192.png server/asset.go

server/asset.go:
server/asset.go: $(shell find bindata)
go-bindata -prefix bindata -pkg server -ignore=\\.gitkeep -o server/asset.go bindata/...
gofmt -w server/asset.go

Expand All @@ -25,6 +25,9 @@ bindata:
bindata/static: bindata
mkdir bindata/static

bindata/static/spice:
cp -r js/spice-web-client bindata/static/spice

bindata/static/index.html: bindata/static resources/index.html
cp resources/index.html bindata/static/index.html

Expand Down Expand Up @@ -56,7 +59,7 @@ js/node_modules/xterm/dist/xterm.css:
cd js && \
npm install

bindata/static/js/gotty.js: js/src/* js/node_modules/webpack
bindata/static/js/gotty.js: js/src/
cd js && \
npx webpack

Expand Down
Empty file added js/index.html
Empty file.
22 changes: 11 additions & 11 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions js/spice-web-client/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The MIT License (MIT)
Copyright (c) 2016 eyeOS S.L.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
99 changes: 99 additions & 0 deletions js/spice-web-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#Complete Spice Web Client written in HTML5 and Javascript
Full and complete implementation of the SPICE protocol (by Red Hat) written in HTML5 and JavaScript. It allows any standard HTML5-ready Web Browser to connect to remote
virtual sessions just by accessing a single URL.

The client can be deployed through a normal web server to connect to spice sessions. To use it you would need to proxy your spice session through a websockets-to-tcp
proxy like Kanaka, Websockify or similar projects.

NOTE: This project is NOT based on the spice-html5 prototype.

## Features

- Full QXL Support of the entire spice protocol, including clipping, masking, scaling etc (accelerated mode)
- Audio support, but only for raw audio samples, not for celt
- Full KeyBoard support including English, Spanish and Catalan layouts
- Clipboard sharing support with customizble interface
- Video streaming support with excellent performance even at 60fps FHD 1080p
- Extremly high performant LZ decoder with sub <10ms for a FHD 1080P image
- Pure Javascript codec for quic
- Configurable multi core support using webworkers (by default it uses 4 CPU Cores)
- Spice Agent support
- Set resolution support
- Honors spice cache for images, cursors and palettes
- Very low memory footprint for a javascript application like this
- Spice authentication tokens support
- Supports graphic live debugging the spice protocol and to replay packets to fix bugs

##Missing features

There are some SPICE features still to be implemented, the most important ones are:

- Celt or other audio codec
- USB redirection (not possible at browser level, maybe with a plugin?)

##Client System requirements

To get the best result we recommend at least 1GB of ram and at least two cores at 1,5ghz.

It should work decently on 512mb of ram and 1ghz.

We have made tests in raspberry pi 2 with very good results.

##Network requirements

Only Binary websockets are used to send and receive server data, so you should expect similar network requirements than SPICE itself.
for a normal 1080p session the performance is very good up to 150-200ms of latency and 100kb/s bandwidth.

The network consumption of a spice session depends a lot on the usage patterns.

##Performance

Writing a web client for a protocol like spice is challenge because of the limited access to system resources like GPU and the way the javascript VM works.

We have spent almost 2 years profiling the entire project. The lz decoder has been optimized to <10Ms for full hd images. Quic codec has been hacked a lot
to get acceptable performance even being executed in javascript.

We have created a graphic pipeline to remove unnecesary draw operations that are going to be overdrawn at the next known packets. We have minimized the work
for the javascript GC and refined all our canvas operations and all the entire stack to prevent big data structures to be copied.

You should expect a near perfect experience if you meet the client requirements and the network requirements.

##Browser support

We strongly recommend use the spice web client with Chromium/Chrome or Firefox, however it should work at least on:

- Google Chrome
- Firefox
- Internet Explorer 11
- Edge


##How to use it

In order to work you only need to provide the IP address of the websockets proxy and the port
of the websockets proxy.

You can do it permanently editing run.js or through the URL using the parameters:

http://example.com/spice-web-client/index.html?host=IP_ADDRESS_OF_WEBSOCKIFY&port=TCP_PORT_OF_WEBSOCKIFY

By doing this you will connect to the remote spice session and the resolution will be adapted to your browser viewport area.

##Notes For linux sessions
If you are planning to use this to connect to remote linux sessions you should consider disabling compositing on your desktop. The best performance is achieved with
kde with compositing and visual effects disabled.

Always install the spice-vdagent and xorg-qxl to get the best results and to have custom resolutions etc.

##Notes For Windows sessions

Spice web client has a very good performance connecting to remote windows sessions. Always install the spice-agent package including the qxl video driver to get the best results and to have custom resolutions etc.

##More information

For more information about the implementation or questions about roadmap etc contact Jose Carlos Norte (jcarlosn) at [email protected]

##License

Spice Web Client is distributed under the terms of the [MIT license](https://opensource.org/licenses/MIT).

Loading