User Tools

Site Tools


wiki:advanced:x2gohtmlclient

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:advanced:x2gohtmlclient [2021/12/31 20:55]
mikep Fix placement of index.html
wiki:advanced:x2gohtmlclient [2022/10/03 13:34] (current)
gratuxri [proof of concept installation on Ubuntu GNU/Linux from Launchpad PPA]
Line 9: Line 9:
 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.
  
-{{:wiki:advanced:client.png?400|}} 
 {{:wiki:advanced:kdr.png?400|}} {{:wiki:advanced:kdr.png?400|}}
  
 ====== Components ====== ====== Components ======
  
-===== X2GoHTMLClient =====+===== x2gohtmlclient =====
  
-==== index.html ====+Contains the JavaScript and other assets that are served to a browser. The main page is ''index.html'', and it provides two modes: a native client and an embedded client. The native client requires that a recent version of the X2Go client exists on the same computer as the browser. The embedded client provides the HTML5-based functionality. In any case, ''index.html'' prompts the user for: 
 +  * the X2Go server address, 
 +  * a username, 
 +  * a password, 
 +  * the desktop environment to start, 
 +  * whether to use an SSH proxy, 
 +  * an optional proxy username, and 
 +  * an optional proxy password.
  
-Client HTML page. This page can be modified or embedded in existing webpage. It has two modesnative client and embedded client. User can use native client if recent version of X2Go client is installed on the system. In this case, the page will generate x2go session file, which will be automatically opened with x2go client. Second mode is to use embedded HTML Client (only supports X2GoKdrive). The HTML page provides user input for the next settings: +{{:wiki:advanced:client.png?400|}}
-<code> +
-X2Go Server address +
-Username +
-Password +
-Command to execute (KDE, GNOME, ICEWM, etc) +
-SSH Proxy (if not specified no proxy will be used) +
-Proxy login +
-Proxy password +
-</code> +
-The HTML page can be modified to predefine one or more of this settings. Important functions inside of this page should be defined: +
-<code>function getServer() +
-function getUname() +
-function getPass() +
-function getCommand() +
-function getName() +
-function getProxy() +
-function getProxyUser() +
-function getProxyPass() +
-</code>+
  
-==== x2gokdriveclient.html ====+''index.html'' can be edited to set a default server and so on. 
 +The file ''x2gokdriveclient.html'' allows for running the X2Go client in a separate window.
  
-The HTML Page to run X2Go client in separate windowBy default the session's window is embedded in the start page. User can "detach" the session to separate window using "new window" buttonAfter that session will be shown in the separate window and can be resizedopened in full screen, etc.+The x2gohtmlclient package also provides CSS, images, and three JavaScript classes: 
 +  -   ''x2godomcontroller.js'', which handles communication between the HTML page and the X2Go HTML client; 
 +  -   ''x2gohtmlclient.js'', which handles communication between the X2Go RPC script and the X2Go HTML client; and 
 +  -   ''x2gokdrivehtmlclient.js''which implements the X2Go KDrive client.
  
-==== CSS/x2gostyle.css ====+===== x2gowebrpc =====
  
-WEB styles for HTML pages +The x2gorpc.cgi CGI script connects to the X2Go server using SSH and starts sessions, resumes sessions, starts SSH tunnels and so on in response to requests from the browser. This involves using SSH to run ''x2golistsessions''run ''x2gostartagent'', start a tunnel using SSH's ''-N'' and ''-L'' arguments, run ''x2goruncommand'', and run ''x2gowswrapper''.
- +
-==== SRC/*png SRC/*svg ==== +
- +
-Image resources +
- +
-==== SRC/x2godomcontroller.js ==== +
- +
-Communication between HTML page and X2Go HTML Client +
- +
-==== SRC/x2gohtmlclient.js ==== +
- +
-Communication between X2Go RPC script and X2Go HTML Client +
- +
-==== SRC/x2gokdrivehtmlclient.js ==== +
- +
-X2GoKdrive JS client +
- +
-===== x2gorpc.cgi ===== +
- +
-CGI script for communication between HTML Client and X2Go server. It connects to X2Go server using ssh, starts/resuming sessions, opens SSH tunnels, etc+
  
 ===== x2gowswrapper ===== ===== x2gowswrapper =====
  
-The application that 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.
  
 ====== Configuring the Web Server ====== ====== Configuring the Web Server ======
  
 We describe how to configure NGINX and fcgiwrap, but you can substitute any web server that provides the needed features. We describe how to configure NGINX and fcgiwrap, but you can substitute any web server that provides the needed features.
- +Here is an example NGINX configuration:
-''/etc/nginx/sites-available/<your host>-ssl:''+
 <file> <file>
 server { server {
Line 122: Line 92:
 } }
 </file> </file>
 +Note that the location ''/x2gows/PORT'' gets proxied to a process on localhost listening to PORT. The is the x2gowswrapper process.
  
 ====== Building and Installing ====== ====== Building and Installing ======
Line 130: Line 101:
 The output will be ''dist/x2gokdriveclient.min.js'', and you should copy this file to ''$WEBROOT/assets/js/''. The output will be ''dist/x2gokdriveclient.min.js'', and you should copy this file to ''$WEBROOT/assets/js/''.
  
-The other assets should be installed as follows:+The other assets should be installed as follows. Create the parent directories as required.
   * Place ''index.html'' in ''$WEBROOT/''.   * Place ''index.html'' in ''$WEBROOT/''.
   * Place ''css/*'' in ''$WEBROOT/assets/css/''.   * Place ''css/*'' in ''$WEBROOT/assets/css/''.
Line 159: Line 130:
 Ensure the values of ''ssl_cert'' and ''ssl_key'' match the corresponding values in NGINX's configuration, Ensure the values of ''ssl_cert'' and ''ssl_key'' match the corresponding values in NGINX's configuration,
 and ensure the user running NGINX can read the files at both paths as well as the configuration file itself. and ensure the user running NGINX can read the files at both paths as well as the configuration file itself.
 +
 +===== proof of concept installation on Debian GNU/Linux =====
 +
 +<code>
 +sudo apt install extrepo
 +sudo extrepo enable x2go
 +sudo apt update
 +sudo apt install x2gohtmlclient
 +</code>
 +
 +===== proof of concept installation on Ubuntu GNU/Linux from Launchpad PPA =====
 +
 +<code>
 +sudo add-apt-repository ppa:x2go/nightly
 +sudo add-apt-repository ppa:x2go/ppa
 +sudo apt update
 +sudo apt install x2gohtmlclient
 +</code>
wiki/advanced/x2gohtmlclient.1640984107.txt.gz · Last modified: 2021/12/31 20:55 by mikep