qlik-oss / enigma.js

JavaScript library for consuming Qlik's Associative Engine.
MIT License
209 stars 82 forks source link

Socket closed in chrome but working fine in Edge browser enigma js + qlik sense #795

Closed hshahul closed 4 years ago

hshahul commented 4 years ago

Hi Team,

I am trying to connect Qlik sense with Enigma js, it is working fine in Edge browse but not working in chrome browser. I am getting the following error.

Uncaught (in promise) code: -1 message: "Socket closed"

can you please suggest have any special settings needed for chrome

axelssonHakan commented 4 years ago

Could you please provide some more information.

Any code example? Any more logging?

hshahul commented 4 years ago

No logs, i am getting socket close error only. I am using our sample qlik connect code only.

const enigma = require('enigma.js'); const WebSocket = require('ws'); const schema = require('enigma.js/schemas/12.170.2.json');

// create a new session: const session = enigma.create({ schema, url: 'ws://localhost:9076/app/engineData', createSocket: url => new WebSocket(url), });

Error: code: -1 message: "Socket closed" proto: Object

but I am able to get connect and data from Qlik in edge browser,

Previously it is working in chrome browser, now only facing the issue ..........( no code change)

axelssonHakan commented 4 years ago

What is different between this issue and #800 ???

If you are using web browsers is usually best to use the WebSocket API that's included in the browser (don't require ws) How do you transpile your code?

hshahul commented 4 years ago

both are same issue only.

I tried wss / ws also, but not working fine. can you please websocket API sample code.

axelssonHakan commented 4 years ago

Are you using Qlik Sense Desktop?

axelssonHakan commented 4 years ago

both are same issue only.

I tried wss / ws also, but not working fine. can you please websocket API sample code.

see #800

axelssonHakan commented 4 years ago

Duplicate of #800

hshahul commented 4 years ago

I am using Qlik web only

axelssonHakan commented 4 years ago

In your code you are trying to connect to localhost:9076 url: 'ws://localhost:9076/app/engineData',

You need to use the URL for the web deployment and also configure web-integration https://github.com/qlik-oss/web-integration-examples

hshahul commented 4 years ago

I am using web url api only, for sample,i gave the sample code. except localhost, everything same only. but no luck.