This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
wiki:advanced:x2gohtmlclient [2021/12/31 19:30] mikep Fix indentation of NGINX configuration |
wiki:advanced:x2gohtmlclient [2022/01/02 18:56] mikep Add x2gowswrapper to commands run by x2gowebrpc |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
====== Introduction ====== | ====== Introduction ====== | ||
Line 9: | Line 8: | ||
* python-websockify. | * python-websockify. | ||
X2Go provides instructions for configuring the NGINX web server, but you can substitute another server if you prefer. Your operating system distribution likely provides packages containing the dependencies not provided by X2Go. | X2Go provides instructions for configuring the NGINX web server, but you can substitute another server if you prefer. Your operating system distribution likely provides packages containing the dependencies not provided by X2Go. | ||
+ | |||
+ | {{: | ||
====== Components ====== | ====== Components ====== | ||
- | ===== X2GoHTMLClient | + | ===== x2gohtmlclient |
- | ==== index.html | + | Contains the JavaScript and other assets that are served to a browser. The main page is '' |
- | Client HTML page. This page can be modified or embedded in existing webpage. It has two modes: native client and embedded client. | + | * the X2Go server |
- | < | + | * a username, |
- | X2Go Server | + | * a password, |
- | Username | + | * the desktop environment |
- | Password | + | * whether to use an SSH proxy, |
- | Command | + | * an optional proxy username, and |
- | SSH Proxy (if not specified no proxy will be used) | + | * an optional proxy password. |
- | Proxy login | + | |
- | Proxy password | + | {{: |
- | </ | + | |
- | The HTML page can be modified to predefine one or more of this settings. Important functions inside of this page should be defined: | + | |
- | < | + | |
- | function getUname() | + | |
- | function getPass() | + | |
- | function getCommand() | + | |
- | function getName() | + | |
- | function getProxy() | + | |
- | function getProxyUser() | + | |
- | function getProxyPass() | + | |
- | </ | + | |
- | ==== x2gokdriveclient.html ==== | + | |
- | The HTML Page to run X2Go client | + | |
- | ==== CSS/ | + | '' |
- | WEB styles | + | The file '' |
- | ==== SRC/*png SRC/*svg ==== | + | The x2gohtmlclient package also provides CSS, images, and three JavaScript classes: |
- | Image resources | + | |
+ | - '' | ||
+ | - '' | ||
- | ==== SRC/ | + | ===== x2gowebrpc |
- | Communication between HTML page and X2Go HTML Client | + | |
- | ==== SRC/ | + | |
- | Communication between X2Go RPC script and X2Go HTML Client | + | |
- | ==== SRC/ | + | |
- | X2GoKdrive JS client | + | |
- | ===== x2gorpc.cgi | + | The x2gorpc.cgi CGI script connects to the X2Go server using SSH and starts sessions, |
- | CGI script | + | |
===== x2gowswrapper ===== | ===== x2gowswrapper ===== | ||
- | The application which is connecting TCP sockets of X2GoKdrive agent with web sockets for HTML Client. | ||
+ | The x2gowswrapper program connects the TCP sockets of the X2Go KDrive agent with WebSockets created by the browser. | ||
- | ====== | + | ====== |
- | ====== JS classes ====== | + | We describe how to configure NGINX and fcgiwrap, but you can substitute any web server that provides the needed features. |
- | JS classes should be compiled in one using script minify.sh. The resulting file x2goclient.js will be placed in subdir " | + | Here is an example |
- | + | ||
- | ====== x2gowswrapper ====== | + | |
- | Build using qmake | + | |
- | < | + | |
- | $qmake-qt5 && make | + | |
- | </ | + | |
- | + | ||
- | ====== Installation ====== | + | |
- | + | ||
- | Prerequements: | + | |
- | + | ||
- | Example of nginx configuration | + | |
- | + | ||
- | ''/ | + | |
< | < | ||
server { | server { | ||
listen 443 ssl; | listen 443 ssl; | ||
server_name your_host; | server_name your_host; | ||
- | ssl_certificate | + | ssl_certificate |
- | ssl_certificate_key | + | ssl_certificate_key |
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256: | ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256: | ||
ssl_protocols TLSv1.2; | ssl_protocols TLSv1.2; | ||
Line 122: | Line 92: | ||
} | } | ||
</ | </ | ||
+ | Note that the location ''/ | ||
- | X2Go HTML client files: | + | ====== Building and Installing ====== |
- | < | + | |
- | <WEB ROOT>/ | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | </ | + | ===== x2gohtmlclient ===== |
- | This location can be changed, in this case the changes should be also done in the WEB Server configuration file and in index.html file: | + | Run '' |
- | < | + | The output will be '' |
- | var RPC_path="/ | + | |
- | var asset_path=" | + | |
- | </ | + | |
- | x2gorpc.cgi should be executable | + | |
- | install x2gowswrapper to /usr/bin | + | The other assets should be installed as follows. Create the parent directories as required. |
+ | * Place '' | ||
+ | * Place '' | ||
+ | * Place '' | ||
- | x2gowswarpper configuration: | + | ===== x2gowebrpc ===== |
- | / | + | Copy '' |
- | < | + | |
- | ws_proto=wss | + | |
- | ssl_cert=< | + | |
- | ssl_key=< | + | |
- | ssl_only=true | + | |
- | log_dir=/ | + | |
- | </file> | + | |
- | the SSL key should be same which used for WEB server. | + | |
- | Because | + | ===== x2gowswrapper |
- | create log directory for x2gowswarpper: | + | Build x2gowswrapper using qmake: |
< | < | ||
- | #mkdir / | + | $ qmake-qt5 && make |
- | #chown www-data / | + | |
</ | </ | ||
+ | Install the resulting program named x2gowswrapper to ''/ | ||
- | to use x2go HTML client open in web browser: | + | Create the directory ''/ |
+ | Create the file named ''/ | ||
< | < | ||
- | https://<your host>/assets/x2go-plugin/ | + | ws_proto=wss |
+ | ssl_cert=/etc/pki/nginx/server.crt | ||
+ | ssl_key=/etc/ | ||
+ | ssl_only=true | ||
+ | log_dir=/ | ||
</ | </ | ||
- | + | Ensure the values of '' | |
- | {{: | + | and ensure the user running NGINX can read the files at both paths as well as the configuration file itself. |
- | {{: | + |