Sunday, 10 February 2019

websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503

I'm trying to connect to qlik using certificates through websockets.

Error:

websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503

Code:

from websocket import create_connection  
import ssl  


senseHost = "dummy.xyz.com"  
privateKeyPath = "C:\ProgramData\Qlik\Sense\Repository\Exported Certificates\"  


## userDirectory and userId can be found at QMC -> Users  
userDirectory, userId = "DIRECTORY_OF_SERVER","QlikServerUserId"  


url = "wss://" + senseHost + ":4747/app"  # valid  
certs = ({"ca_certs": privateKeyPath + "root.pem",  
            "certfile": privateKeyPath + "client.pem",  
            "keyfile": privateKeyPath + "client_key.pem",  
            "cert_reqs":ssl.CERT_REQUIRED,  
            "server_side": False  
            })  
ssl.match_hostname = lambda cert, hostname: True  
ws = create_connection(url, sslopt=certs,
                       http_proxy_host="xyz.corp.company.com",
                       http_proxy_port="80",
                       http_no_proxy="*.corp.company.com;*.abc.com;*.pqr.com;"
                       header={'X-Qlik-User: UserDirectory=%s; UserId=%s'% (userDirectory, userId)})  
session = self.ws.recv()

*Note:

  • My network has proxy.
  • I have used right values in every field like sensehost, userDirectory, userId

Please help or any suggestions can be appreciated to connect qlik.

Final aim: To get Qlik KPI values/charts into fronted developed by django dynamically!



from websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503

No comments:

Post a Comment