Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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
Anonymous
Not applicable
Author

Hi,

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

Vincenzo_Esposito

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

s29124141
Partner - Creator II
Partner - Creator II

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.

Anonymous
Not applicable
Author

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.

jelle_vervloess1
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

s29124141
Partner - Creator II
Partner - Creator II

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

Anonymous
Not applicable
Author

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

s29124141
Partner - Creator II
Partner - Creator II

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.

oknotsen
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!