Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik Sense - External Web Server Websocket Error

Hi all,

I have recently set-up an external web server using Laragon and am having some difficulties in setting up the connection to Qlik Sense.

It is currently throwing up the following error message:

2015-10-01 15_45_56-GIADAFLUX - Remote Desktop Connection.png

This is the config code I have in the JS file.

var config = {

  host: "myhostname",

  prefix: "/",

  port: 443,

  isSecure: true,

  rejectUnauthorized: false

};

Would appreciate any assistance in resolving this issue!

Cheers,

Joel

13 Replies
mbj
Employee
Employee

hi,

key things

* Configure CORS header in proxy settings

* configure hostname in whitelist.

See Qlik Sense API and integration demo for more info. See web integration or search for CORS, whitelist etc.

mbj
Employee
Employee

hi,

<from: web integration whitepaper on generic tab from integration.qlik.com/documentation>

Try to keep all assets on your Sense server. so in your HTML you only replace the hostname of your css and require.js file. Then you won't get the fonts issue.

If you really have to put our stuff on your external server, see below...

Appendix A: DIV tag integration approach on external server

  • You create a normal HTML page which you can create with "drag and drop" in our dev-hub.  Using this approach you can link the DIV to a Sense chart ID.
  • You can better link to the Sense server or you copy our requireJS, CSS and fonts to your webserver.
RequireJSC:\Program Files\Qlik\Sense\Client\assets\external\requirejs<script src="../../resources/assets/external/requirejs/require.js"></script>
CSSC:\Program Files\Qlik\Sense\Client\autogenerated Include<link rel="stylesheet" href="../../resources/autogenerated/qlik-styles.css">
FontsGo to C:\Program Files\Qlik\Sense\Client\fonts on your Sense server.In your external webserver create a resources/fonts directory (in your web server root) and copy the fonts
You include a reference to these local files (to prevent cross site scripting); The require.js, the css and the fonts from above.E.g. I have put them in the server\public folder on my external web server. fonts.png

  1. You create a Javascript file
    1. This file contains a config object, which points to your Sense Server. This file is basically the "bridge" between your website and Sense
    2. In this javascript file you attach a DIV id to a Sense Chart ID (is being generated for you if you drag and drop), and you are done.

var config = {
        host: "myhost.com",
        prefix: "/",
        port: window.location.port,
        isSecure: true
};
require(["js/qlik"], function(qlik) {
        // open the app
        var app = qlik.openApp("c31e2aba-3b46-4b13-8b87-c5c2514dea1d", config);
        // insert Qlik objects into the page.
        app.getObject(document.getElementById("LB01"), "uPyZavD");

web integration integration Flow.png

From <https://help.qlik.com/en-US/sense-developer/2.2/Subsystems/APIs/Content/MashupAPI/qlik-interface-int...>

From: https://help.qlik.com/en-US/sense-developer/2.2/Subsystems/Mashups/Content/mashups-introduction.htm

PS: note that if you create a new project in the dev-hub, it will generate a starting template for you with the HTML, CSS and the javascript file. This tool will also generate the object guids (id)  for you.

Not applicable
Author

Thank you mbj‌I'll try.

Anonymous
Not applicable
Author

I had exactly the same websocket issue as you. I followed the steps from mbj and from other posts... And realized that I forgot to add the Servers in the "Host White List". It works perfectly for me now. Hope you could solve your problem