Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
steeramp
Partner - Creator II
Partner - Creator II

WebSocket connection to 'ws://1xx.xx.xxx.xx/sense/app/' failed: Error during WebSocket handshake

Hello To everyone ,

someone can give help me about Websocket Connection ?  here the Html Code:

 

<!doctype html>
<html qva-bootstrap="false">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Qlik Sense </title>
<meta charset="utf-8">

<meta http-equiv="cleartype" content="on">

<!--Project code -->

<link rel="stylesheet" href="css/main.css">

<script type = "text/javascript">
function testqs(){

var ws = new WebSocket("ws://185.xxx.xxx.xx/sense/app/");  //  or  ("wss://yyyy.yyyyy.ch:4747/app/");

ws.onopen = function(event) {

// Web Socket is connected, send data using send()
ws.send("Message to send");
alert("Message is sent...");
console.log("Log 3");
};

 


}

</script>

</head>
<body style="overflow:auto">

<div ui-view></div>
<button type="button" onclick="testqs()"> Click to start testqs</button>

</body>
</html>

Labels (3)
2 Replies
iharsh220
Contributor III
Contributor III

Hi,

as i said you have to use qlik mashup for connectivity

download zip and extract into 

C:\Users\"username"\Documents\Qlik\Sense\Extensions

and use Capability API

iharsh220
Contributor III
Contributor III

HI,

even you can try with nodejs 

here its link

https://help.qlik.com/en-US/sense-developer/February2019/Subsystems/EngineAPI/Content/Sense_EngineAP...

 

connection with nodejs

const ws = new WebSocket('wss://server.domain.com:4747/app/',

{

rejectUnauthorized: false,

ca: certificates.root,

cert: certificates.cert,

key: certificates.key,

headers: { 'X-Qlik-User': 'UserDirectory=internal; UserId=sa_engine'

}

});

This code only for server side.. not for local machine