Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Network Traffic

This article describes how the Analytics monitor submits data across the network.

Network Traffic from the Monitor

Data is submitted as plain text over HTTP standard port 80 (or HTTPS at 443 if using SSL). It will most likely pass through firewalls and network devices without problems. It can also be inspected by network sniffers and routed via a proxy.

Receiving Endpoint

The receiving endpoint for your product's data is http://<yourproductid>.monitor-eqatec.com. You can test the connectivity to that endpoint by opening up a web-browser and going to that address. For instance, try verifying access to this demo application:

If you get a simple text response saying something like "Analytics - data reception" then your device can successfully connect to the Analytics servers.

Viewing network traffic

You may find it useful to inspect the network traffic using a suitable tool such as Fiddler (Windows) or Charles (MacOSX).

When you are inspecting network traffic we recommend not turning on SSL in the monitor as that makes the capturing more difficult.

If you are on a mobile device then you can e.g. setup Fiddler as network proxy on a regular PC and specify that machine's address as the monitor's proxy address. This will direct network traffic via Fiddler such that you can then inspect it. Below is a Fiddler trace of the network traffic from a Windows Phone app that has been setup to use a regular PC as a proxy, configured in Settings > Wi-Fi > your network:

Viewing monitor network traffic using the Fiddler tool

Setting up a network proxy on Windows Phone

Setting up a Proxy

When deploying your app you may find that some users are located behind proxy servers or a similar intermediary. The Analytics monitor will attempt to connect to the servers using a standard HTTP connection and will optionally setup specific proxy settings if you have configured them on the AnalyticsMonitorSettings instance. However, using these specific settings are typically not desirable unless you know the precise proxy setup of your end users or have a programmatic way of obtaining it. What you typically want is to have your application use the default proxy settings of the underlying system when connecting.

This section will describe how you can explicitly specify proxy settings and some ways of using the default proxy settings.

Explicit monitor proxy settings

If your application needs to explicitly specify a proxy then you can specify the proxy details in the ProxyConfig part of the settings object used to create the monitor. Here are examples:

    // C# for .NET; ignored on Silverlight, WinRT, Windows Phone
    IAnalyticsMonitorSettings settings = AnalyticsMonitorFactory.CreateSettings("key");
    settings.ProxyConfig.ProxyConnectionString = "MyProxyServer:8080";
    settings.ProxyConfig.ProxyUserName = "myusername";
    settings.ProxyConfig.ProxyPassword = "mypassword";
    IAnalyticsMonitor monitor = AnalyticsMonitorFactory.CreateMonitor(settings);
    ' VB.NET; ignored on Silverlight, WinRT, WindowsPhone
    Dim settings As IAnalyticsMonitorSettings = AnalyticsMonitorFactory.CreateSettings("key")
    settings.ProxyConfig.ProxyConnectionString = "MyProxyServer:8080"
    settings.ProxyConfig.ProxyUserName = "myusername"
    settings.ProxyConfig.ProxyPassword = "mypassword"
    Dim monitor As IAnalyticsMonitor = AnalyticsMonitorFactory.CreateMonitor(settings)
    // Javascript for AppBuilder; ignored on Android and Windows Phone
    var settings = global.plugins.EqatecAnalytics.Factory.CreateSettings("key");
    settings.ProxyConfig.Host = "MyProxyServer";
    settings.ProxyConfig.Port = 8080;
    settings.ProxyConfig.UserName = "myusername";
    settings.ProxyConfig.Password = "mypassword";
    var monitor = global.plugins.EqatecAnalytics.Factory.CreateMonitor(settings);
    // C++ for Windows
    IAnalyticsMonitorSettings *settings = AnalyticsMonitorFactory::CreateSettings("key", "1.0");
    ProxyConfiguration *proxy = settings->ProxyConfig(); // convenient temp var
    proxy->SetHost("MyProxyServer");
    proxy->SetPort(8080);
    proxy->SetUserName("myusername");
    proxy->SetPassword("mypassword");
    IAnalyticsMonitor *monitor = AnalyticsMonitorFactory::CreateMonitorWithSettings(settings);
    // C for Windows
    Eqatec_IAnalyticsMonitorSettings *settings =
            Eqatec_AnalyticsMonitorFactory_CreateSettings("key", "1.0");
    Eqatec_ProxyConfiguration *proxy =
            Eqatec_IAnalyticsMonitorSettings_ProxyConfig(settings); // convenient temp var
    Eqatec_ProxyConfiguration_SetHost(proxy, "MyProxyServer");
    Eqatec_ProxyConfiguration_SetPort(proxy, 8080);
    Eqatec_ProxyConfiguration_SetUserName(proxy, "myusername");
    Eqatec_ProxyConfiguration_SetPassword(proxy, "mypassword");
    Eqatec_IAnalyticsMonitor *monitor =
            Eqatec_AnalyticsMonitorFactory_CreateMonitorWithSettings(settings);
    // Objective-C for iOS and MacOSX
    EQATECAnalyticsMonitorSettings *settings =
            [EQATECAnalyticsMonitorSettings settingsWithProductId:@"key" version:@"1.0"];
    EQATECProxyConfiguration *proxy = [settings proxyConfig]; // convenient temp var
    [proxy setHost:@"MyProxyServer"];
    [proxy setPort:8080];
    [proxy setUserName:@"myusername"];
    [proxy setPassword:@"mypassword"];
    EQATECAnalyticsMonitor *monitor = [EQATECAnalyticsMonitor monitorWithSettings:settings];

Note that programmatic proxy settings are not supported on a number of platforms:

  • Javascript, Java, Android, Silverlight, WinRT, Windows Phone

Proxy setup in .NET

In .NET the default proxy behavior of your application can be altered by using the configuration file. The configuration file offers a specific element for setting up your default proxying within the application. For instance, you may want to use the default credentials when authenticating through the proxy server. Passing the default credentials to the proxy server is turned off by default but can be enabled by adding the following code to your application config:

<system.net>
    <defaultProxy useDefaultCredentials="true" />
</system.net>

When the monitor is delivering data to the Analytics servers it uses the standard HttpWebRequest in the BCL. When created, an HttpWebRequest instance inherits the default proxy settings exposed from the WebRequest.DefaultWebProxy static property. You can alter this default by assigning your own proxy to this static property so if you want to use the default credentials for authentication you can do the following

var webProxy = WebProxy.GetDefaultProxy();
webProxy.UseDefaultCredentials = true;
WebRequest.DefaultWebProxy = webProxy;

The choice between configuration and code is really up to your individual application. Please note that the monitor, unless explicitly configured otherwise using explicit proxy settings described earlier, uses the default proxy within your application. This means that ultimately the ability to actually obtain connectivity and reach the servers is a responsibility that falls outside the scope of the monitor and lays with the hosting application.

For some proxy authentication scenarios you may need to explicitly ask that the Expect:100-Continue header is not appended to the server request. This can typically be done by explicitly setting the System.Net.ServicePoint.Expect100Continue property to false in your application:

// Ensure Expect:100-Continue header is not appended
System.Net.ServicePoint.Expect100Continue = false;

Proxy setup in COM

If you are using the COM monitor you are actually using a customized version of the .NET monitor that has an exposed surface on COM. For that reason the issues with proxy setup are similar when using the COM monitor. Since the COM exposed library is utilized from your (non .NET) application the proxy settings cannot be handled in code but must be handled using the configuration file.

For COM integration you should create a settingsfile named [yourapplication].exe.config with the proxy configuration above. When integrating into the COM library these settings will get picked up and utilized by the .NET runtime. For details you can refer to this question or this blog post.

Using SSL

The default transport protocol is HTTP on port 80. This can be changed to HTTPS over port 443 by setting the UseSSL flag in the settings object. Here are examples for all platforms:

    // C# for .NET
    IAnalyticsMonitorSettings settings = AnalyticsMonitorFactory.CreateSettings("key");
    settings.UseSSL = true;
    IAnalyticsMonitor monitor = AnalyticsMonitorFactory.CreateMonitor(settings);
    ' VB.NET
    Dim settings As IAnalyticsMonitorSettings = AnalyticsMonitorFactory.CreateSettings("key")
    settings.UseSSL = True
    Dim monitor As IAnalyticsMonitor = AnalyticsMonitorFactory.CreateMonitor(settings)
    // Javascript for AppBuilder
    var settings = global.plugins.EqatecAnalytics.Factory.CreateSettings("key");
    settings.UseSsl = true;
    var monitor = global.plugins.EqatecAnalytics.Factory.CreateMonitor(settings);
    // Javascript for web apps
    var settings = window.eqatecUtil.createSettings("key", "1.0");
    settings.UseSsl = true;
    var monitor = window.eqatecUtil.CreateMonitor(settings);
    // C++ for Windows
    IAnalyticsMonitorSettings *settings = AnalyticsMonitorFactory::CreateSettings("key", "1.0");
    settings->SetUseSSL(true);
    IAnalyticsMonitor *monitor = AnalyticsMonitorFactory::CreateMonitorWithSettings(settings);
    // C for Windows
    Eqatec_IAnalyticsMonitorSettings *settings =
            Eqatec_AnalyticsMonitorFactory_CreateSettings("key", "1.0");
    Eqatec_IAnalyticsMonitorSettings_SetUseSSL(settings, true);
    Eqatec_IAnalyticsMonitor *monitor =
            Eqatec_AnalyticsMonitorFactory_CreateMonitorWithSettings(settings);
    // Objective-C for iOS and MacOSX
    EQATECAnalyticsMonitorSettings *settings =
            [EQATECAnalyticsMonitorSettings settingsWithProductId:@"key" version:@"1.0"];
    [settings setUsesSSL:YES];
    EQATECAnalyticsMonitor *monitor = [EQATECAnalyticsMonitor monitorWithSettings:settings];
    // Java for Android and Java
    IAnalyticsMonitorSettings settings =
            AnalyticsMonitorFactory.createSettings("key", new Version("1.0"));
    settings.setUseSSL(true);
    IAnalyticsMonitor monitor = AnalyticsMonitorFactory.createMonitor(settings);

ServerUri

By default, the monitor library will generate a default url to the server endpoint on the Analytics servers which is valid in almost all situations. This default url can be retrieved through the ServerUri property.

However, your application may be deployed in a scenario where there are e.g. specific internal DNS rules or corporate settings applied to internet connectivity and for those scenarios you can assign to the ServerUri property to circumvent specific infrastructure concerns.

    // C# for .NET
    IAnalyticsMonitorSettings settings = AnalyticsMonitorFactory.CreateSettings("key");
    settings.ServerUri = new Uri("http://specialized.example.com");
    IAnalyticsMonitor monitor = AnalyticsMonitorFactory.CreateMonitor(settings);
    ' VB.NET
    Dim settings As IAnalyticsMonitorSettings = AnalyticsMonitorFactory.CreateSettings("key")
    settings.ServerUri = New Uri("http://specialized.example.com")
    Dim monitor As IAnalyticsMonitor = AnalyticsMonitorFactory.CreateMonitor(settings)
    // Javascript for AppBuilder
    var settings = global.plugins.EqatecAnalytics.Factory.CreateSettings("key");
    settings.ServerUri = "http://specialized.example.com";
    var monitor = global.plugins.EqatecAnalytics.Factory.CreateMonitor(settings);
    // Javascript for web apps
    var settings = window.eqatecUtil.createSettings("key", "1.0");
    settings.ServerUri = "http://specialized.example.com";
    var monitor = window.eqatecUtil.CreateMonitor(settings);
    // C++ for Windows
    IAnalyticsMonitorSettings *settings = AnalyticsMonitorFactory::CreateSettings("key", "1.0");
    settings->SetServerUri("http://specialized.example.com");
    IAnalyticsMonitor *monitor = AnalyticsMonitorFactory::CreateMonitorWithSettings(settings);
    // C for Windows
    Eqatec_IAnalyticsMonitorSettings *settings =
            Eqatec_AnalyticsMonitorFactory_CreateSettings("key", "1.0");
    Eqatec_IAnalyticsMonitorSettings_SetServerUri(settings, "http://specialized.example.com");
    Eqatec_IAnalyticsMonitor *monitor =
            Eqatec_AnalyticsMonitorFactory_CreateMonitorWithSettings(settings);
    // Objective-C for iOS and MacOSX
    EQATECAnalyticsMonitorSettings *settings =
            [EQATECAnalyticsMonitorSettings settingsWithProductId:@"key" version:@"1.0"];
    [settings setServerUri:@"http://specialized.example.com"];
    EQATECAnalyticsMonitor *monitor = [EQATECAnalyticsMonitor monitorWithSettings:settings];
    // Java for Android and Java
    IAnalyticsMonitorSettings settings =
            AnalyticsMonitorFactory.createSettings("key", new Version("1.0"));
    settings.setServerUri(new URI("http://specialized.example.com"));
    IAnalyticsMonitor monitor = AnalyticsMonitorFactory.createMonitor(settings);

Make sure that the assigned value is redirected to the Analytics servers located at http://yourproductid.monitor-eqatec.com, or https://yourproductid.monitor-eqatec.com if using SSL.

Conclusion

Data is submitted as plain text over HTTP. Traffic can be configured to use SSL instead, and on some platforms programatically send via a proxy. Data can even be routed via an intermediary relaying network.

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.