Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

WiFiMon uses JavaScript in frequently-visited websites to trigger the tests. In Section 1, we provide the instructions to embed the scripts in your website downloading Images and scripts from our Apache Server, i.e. fl-5-205.unil.cloud.switch.ch that is located in Lausanne, Switzerland.

Notably, measurement results, i.e. Download/Upload Rates and Round Trip Times (RTTs) are relative to the WiFiMon Test Server. In case of the Apache Server located in Lausanne, results are relative to this server. For more accurate results, you may setup your own Apache Server to host the images and scripts that enabled the performance test from your server. The instructions to achieve that are presented in Section 2. In that case the fl-5-205.unil.cloud.switch.ch server should be replaced in all mentions below with your server. 

...

Triggering NetTest measurements requires embedding the following lines of code in your website:

<script type="text/javascript" src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/nettest/jquery-3.5.1.min.js"> </script>
<script type="text/javascript" src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/nettest/nettest-swfobject.js"> </script>
<script type="text/javascript" src="https://www.google.com/jsapi"> </script>
<script type="text/javascript" id="settings" agentIp="xxx.xxx.xxx.xxx" testtool="NetTest"
                           imagesLocation="https://fl-5-205.unil.cloud.switch.ch/wifimon/images/" cookieTimeInMinutes=""
                           src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/nettest/runtests.js" defer></script>


  • agentIP (required): Replace "xxx.xxx.xxx.xxx" with the IP address (or domain name) of the WiFiMon Analysis Server.

  • imagesLocation (required): Public link to the folder where the images are downloaded to perform the NetTest measurements.

  • testtool (required): With this attribute, you specify a name for the testtool. WiFiMon Analysis Server relies on the value of this attribute to visualize measurements received from WiFiMon Hardware Probes. Thus, if number x is assigned to a WiFiMon Hardware Probe, you should specify the value of this attribute as "NetTest-x".

  • cookieTimeInMinutes (optional): Duration time (in minutes) to set the cookie in order to prevent repeated measurements and overload the WiFiMon Analysis Server. If empty, "1.5" is assumed, i.e. 90 seconds.

  • If your website already included the jquery.min.js, you have to delete the first line.

  • With the above JavaScript lines, the images (that NetTest is using) and scripts are downloaded from the WiFiMon Test Server located in Lausanne, Switzerland. For more accurate results you can setup your own Apache Server to host the images and scripts. Detailed instructions are provided in paragraph 2.

  • If the above scripts are embedded only to HTTP websites, the attribute hostingWebsite="http" should be added at the last script after the id attribute. This will direct the measurements to the Non-Secure WiFiMon Agent running on port 9000.

...

Triggering boomerang measurements requires embedding the following lines of code in your website:

<script type="text/javascript" src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/boomerang/jquery-3.5.1.min.js"> </script>
<script type="text/javascript" src="https://www.google.com/jsapi"> </script>
<script type="text/javascript" src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/boomerang/boomerang.js"> </script>
<script type="text/javascript" src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/boomerang/bw.js"> </script>
<script type="text/javascript" src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/boomerang/rt.js"> </script>
<script type="text/javascript" id="settings" agentIp="xxx.xxx.xxx.xxx" testtool="boomerang"
                           imagesLocation="https://fl-5-205.unil.cloud.switch.ch/wifimon/images/" cookieTimeInMinutes="" 
                           src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/boomerang/boomerang-trigger.js" defer></script>


  • agentIP (required): Replace "xxx.xxx.xxx.xxx" with the IP address (or domain name) of the WiFiMon Analysis Server.

  • imagesLocation (required): Public link to the folder where the images are downloaded to perform the boomerang measurements.

  • testtool (required): With this attribute, you specify a name for the testtool. WiFiMon Analysis Server relies on the value of this attribute to visualize measurements received from WiFiMon Hardware Probes. Thus, if number x is assigned to a WiFiMon Hardware Probe, you should specify the value of this attribute as "boomerang-x".

  • cookieTimeInMinutes (optional): Duration time (in minutes) to set the cookie in order to prevent repeated measurements and overload the WiFiMon Analysis Server. If empty, "1.5" is assumed, i.e. 90 seconds.

  • If your website already included the jquery.min.js, you have to delete the first line.

  • With the above JavaScript lines, the images (that boomerang is using) and scripts are downloaded from the WiFiMon Test Server located in Lausanne, Switzerland. For more accurate results you can setup your own Apache Server to host the images and scripts. Detailed instructions are provided in paragraph 2.

  • If the above scripts are embedded only to HTTP websites, the attribute hostingWebsite="http" should be added at the last script after the id attribute. This will direct the measurements to the Non-Secure WiFiMon Agent running on port 9000.

...

Step 1: Create the following proxy HTML page:

<!DOCTYPE html>
<html>
<head>
<title>Speed worker</title>
<script type="text/javascript" src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/speedtest/jquery-3.5.1.min.js"> </script>
<script type="text/javascript" src="https://www.google.com/jsapi"> </script>
<script type="text/javascript" id="settings" agentIp="xxx.xxx.xxx.xxx" testtool="speedtest" cookieTimeInMinutes="" src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/speedtest/speedworker-post.js"> </script>
</head>
<body>
</body>
</html>



Step 2: Embed the proxy HTML page in your website pages:

<iframe src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/speedtest/speedworker.html" style="visibility: hidden;"></iframe>

...

With the JavaScript lines of the previous section, the images and scripts are downloaded from our WiFiMon Test Server, i.e. fl-5-205.unil.cloud.switch.ch, that is located in Lausanne, Switzerland. Therefore, the performance results will be relative to this server.

...

  • Step 1: Install Apache2 with PHP 7.3. We suggest that you install PHP 7.3. This is the default PHP version of Debian 10:

              sudo apt-get update

              sudo apt-get install -y apache2
              sudo apt-get install -y php php-common
              sudo apt-get install -y libapache2-mod-php7.3
              sudo /etc/init.d/apache2 restart


  • Step 2: Enable Apache2 mod_headers:

              a2enmod headers

              sudo service apache2 restart


  • Step 3: Enable CORS. Add the following lines in the /etc/apache2/apache2.conf file and restart Apache2:

<Files ~ "\.(htm|html|css|dat|js|php|gif|jpg|png|swf)$">

Header always set Access-Control-Allow-Origin "*"

Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"

Header always set Access-Control-Max-Age "1000"

Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"

</Files>


...

  • Step 1: Install Apache2 with PHP 7.3. We suggest that you install PHP 7.3. This is the default PHP version of Debian 10:

              sudo apt-get update
              sudo apt-get install -y apache2
              sudo apt-get install -y php php-common
              sudo apt-get install -y libapache2-mod-php7.3
              sudo /etc/init.d/apache2 restart

  • Step 2: Enable Apache2 mod_headers:

              a2enmod headers
              sudo service apache2 restart

  • Step 3: Enable CORS. Add the following lines in the /etc/apache2/apache2.conf file and restart Apache2:

<Files ~ "\.(htm|html|css|dat|js|php|gif|jpg|png|swf)$">

Header always set Access-Control-Allow-Origin "*"

Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"

Header always set Access-Control-Max-Age "1000"

Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"

</Files>


...

  • Step 1: Install Apache2 with PHP 7.3. We suggest that you install PHP 7.3. This is the default PHP version of Debian 10:

               sudo apt-get update

              sudo apt-get install -y apache2
              sudo apt-get install -y php php-common
              sudo apt-get install -y libapache2-mod-php7.3
              sudo /etc/init.d/apache2 restart


  • Step 2: Enable Apache2 mod_headers:

              a2enmod headers

              sudo service apache2 restart


  • Step 3: Enable CORS. Add the following lines in the /etc/apache2/apache2.conf file and restart Apache2:

<Files ~ "\.(htm|html|css|dat|js|php|gif|jpg|png|swf)$">

Header always set Access-Control-Allow-Origin "*"

Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"

Header always set Access-Control-Max-Age "1000"

Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"

</Files>



  • Step 4: Scripts and Images: Get the images and scripts related to WiFiMon testtools from https://fl-5-205.unil.cloud.switch.ch/testtools/ or from the WiFiMon Bitbucket repo: https://bitbucket.software.geant.org/projects/WFMON/repos/agent/browse/testtools. Place wifimon directory inside the root directory of Apache2 and make the following change:
    • (i) If you have not created a proxy HTML page, you may use proxy.html (included in folder wifimon/js/speedtest) as the proxy HTML page. If this is the case, you will have to replace "xxx.xxx.xxx.xxx" in the agentIP attribute, with the IP address (or domain name) of the server where the WiFiMon Analysis Server is installed. In every case, you will also have to specify the new URLs for the scripts by changing their src attribute.

...

In case you want to include all three types of testtools (NetTest, boomerang, speedtest/HTML) in the same page, inject the following HTML lines in the "head" section of your website:

<iframe src="https://fl-5-205.unil.cloud.switch.ch/wifimon/measurements/nettest.html" style="visibility: hidden;"></iframe>
<iframe src="https://fl-5-205.unil.cloud.switch.ch/wifimon/js/speedtest/speedworker.html" style="visibility: hidden;"></iframe>
<iframe src="https://fl-5-205.unil.cloud.switch.ch/wifimon/measurements/boomerang.html" style="visibility: hidden;"></iframe>

where nettest.html, speedworker.html, boomerang.html include the Javascript lines that trigger the necessary tests.

...