Qlik Community

Ask a Question

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use QlikSense API on a machine which is not QlikSense server

Hi all,

I'm building a web application and I'm trying to use QlikSense API which installed on a different machine.

The "require.js" file is on a remote server (QlikSense server)

My code is:

var config = {

    host: "[qlikSenseserverIP]",

    prefix: "/",

    port: 443,

    isSecure: true

};

  1. require.config({

    baseUrl: (config.isSecure ? "https://" : "http://") + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources"

});

require(["js/qlik"], function (qlik) {

          qlik.setOnError(function (error) {

$('#popupText').append(error.message + "<br>");

$('#popup').fadeIn(1000);

          });

          $("#closePopup").click(function () {

$('#popup').hide();

          });

          var app = qlik.openApp('[appID]', config);

});

I get this error after qlik.openApp('[appID]', config):

"WebSocket connection to 'ws://[qlikSenseserverIP]:443/app/[appID]?reloadUri=http%3A%2F%2Flocalhost%3A2000%2F[myDefaultPage]r%2FReports%2F%3FmenuType%3D1%26menuDes%3DBalance%2520Sheet' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET".

What may be the cause?

9 Replies
Contributor II
Contributor II

Hi,

Could you solve this issue?? I am facing the same issue.

Employee
Employee

I'm considering you replace the qlikSenseserverIP with the actual IP address. If so seems there is something in between your server and QlikSense which cut the the web socket protocol

Partner
Partner

Make sure that you have whitelisted web server host and the ip address in your virtual proxy to allow web socket connections. Looking at the error message it looks like you are testing on localhost, hence add "localhost" as well to your virtual proxy white list.

Contributor II
Contributor II

If I whitelist the webserver host IP address, will I be able to access the web application from other machine. Because I got a Insecure response error in qlik.js when I tried opening the hosted web application in a different machine. In my local machine it worked.

Thanks.

Contributor III
Contributor III

i was strugling with this error asswel (i think), make sure you clear your cache from time to time since the connection could still be saved

Partner
Partner

If its a CORS issue, add access control allow origin to response headers. If not  post the error message and the screenshot.

Contributor II
Contributor II

No I get a error in console like "ERR_INSECURE_RESPONSE" while loading qlik.js

Partner
Partner

Check what authentication you have in place. Try the same by allowing anonymous authentication. If that solves then you are missing qlik session cookie in your requests.

Master III
Master III

Could you explain that a bit more?

What should I be looking for in my script / what is missing where?

May you live in interesting times!