Menu

Home

Eric M.

Quick start guide

Web Client setup

The XOWS files should ideally be placed in a dedicated folder within the web server (or virtual host) document root, meaning, next to the index file.

document_root/xows/              -- XOWS library files
document_root/index.html         -- Virtual host index file

Depending if you want to run the "debug" version or "release" (minified) version, you have to write index.html file with proper script loading sequence.

Here is the typical index.html to run the "release" (minified) version :

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>XOWS</title>
  <script src="xows/xows.min.js"></script>
</head>
<body></body>
<script>
var options = {
  "root"            : "xows",                                  //< Library path (root folder)
  "url"             : "wss://xmppserver.tld/xmpp-websocket/",  //< WebSocket address
  "domain"          : "xmppserver.tld",                        //< XMPP server domain
  "locale"          : "en",                                    //< Interface language
  "theme"           : "dark",                                  //< Interface theme folder (only one available for now)
  "verbose"         : 1,                                       //< Verbosity level (greater number = higher verbosity)
  "uncache"         : false,                                   //< Bypass browser caching mechanism (development purpose)
  "allow_register"  : true,                                    //< Enable the XMPP account registration interface.
  "legacy_vcard"    : true,                                    //< Use the legacy XEP-0054 vcard-temp instead of XEP-0292 vCard4
  "vcard4_notify"   : false,                                   //< Enable XEP-0292 vCard4 Pubsub notifications
  "avatar_notify"   : false,                                   //< Enable XEP-0084 Avatar Pubsub notifications
  "login_delay"     : 2000                                     //< Delay (in milliseconds) between registration and failed attempts 
};
xows_init(options);
</script>
</html>

Here is the typical index.html to run the "debug" version :

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>XOWS</title>
  <script src="xows/xows_base.js"></script> <!-- Base functions and constants -->
  <script src="xows/xows_l10n.js"></script> <!-- l10n Module -->
  <script src="xows/xows_xml.js"></script>  <!-- XML Module -->
  <script src="xows/xows_sasl.js"></script> <!-- SASL Module -->
  <script src="xows/xows_sck.js"></script>  <!-- WebSocket interface Module -->
  <script src="xows/xows_xmp.js"></script>  <!-- XMPP Protocol interface Module -->
  <script src="xows/xows_cach.js"></script> <!-- Cache & Local Storage Module -->
  <script src="xows/xows_cli.js"></script>  <!-- Main Client Module -->
  <script src="xows/xows_tpl.js"></script>  <!-- HTML Templates Module -->
  <script src="xows/xows_doc.js"></script>  <!-- DOM Managment Module -->
  <script src="xows/xows_gui.js"></script>  <!-- User interface Module -->
  <script src="xows/xows_init.js"></script> <!-- Main initialization functions -->
</head>
<body></body>
<script>
var options = {
  "root"            : "xows",                                  //< Library path (root folder)
  "url"             : "wss://xmppserver.tld/xmpp-websocket/",  //< WebSocket address
  "domain"          : "xmppserver.tld",                        //< XMPP server domain
  "locale"          : "en",                                    //< Interface language
  "theme"           : "dark",                                  //< Interface theme folder (only one available for now)
  "verbose"         : 3,                                       //< Verbosity level (greater number = higher verbosity)
  "uncache"         : true,                                    //< Bypass browser caching mechanism (development purpose)
  "allow_register"  : true,                                    //< Enable the XMPP account registration interface.
  "legacy_vcard"    : true,                                    //< Use the legacy XEP-0054 vcard-temp instead of XEP-0292 vCard4
  "vcard4_notify"   : false,                                   //< Enable XEP-0292 vCard4 Pubsub notifications
  "avatar_notify"   : false,                                   //< Enable XEP-0084 Avatar Pubsub notifications
  "login_delay"     : 2000                                     //< Delay (in milliseconds) between registration and failed attempts 
};
xows_init(options);
</script>
</html>