Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python websocket.\u exceptions.WebSocketProxyException:通过代理连接失败状态:503_Python_Python 3.x_Websocket_Http Proxy_Qliksense - Fatal编程技术网

Python websocket.\u exceptions.WebSocketProxyException:通过代理连接失败状态:503

Python websocket.\u exceptions.WebSocketProxyException:通过代理连接失败状态:503,python,python-3.x,websocket,http-proxy,qliksense,Python,Python 3.x,Websocket,Http Proxy,Qliksense,提供的答案需要有关qlik服务器身份验证的更多详细信息 我正试图通过WebSocket使用证书连接到qlik 错误: websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503 from websocket import create_connection import ssl senseHost = "dummy.xyz.com" privateKeyPath = "C

提供的答案需要有关qlik服务器身份验证的更多详细信息

我正试图通过WebSocket使用证书连接到
qlik

错误:

websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503
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()
代码:

websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503
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()
*注意:

websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503
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()
  • 我的网络有一个代理
  • 我在每个领域都使用了正确的值,比如
    sensehost,
    用户目录,用户ID
请提供帮助或任何建议,以连接qlik


最终目标:让django动态开发的Qlik KPI值/图表进入前台

部分答案:

websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503
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()
根据Qlik.NETSDK,他们说
端口:有代理(443)、没有代理(4747)或没有安全性(80)。

因此,我将
url=“wss://”+senseHost+”:4747/app/“
更改为
url=“wss://”+senseHost+”:443/app/“

待定:

websocket._exceptions.WebSocketProxyException: failed CONNECT via proxy status: 503
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()
无法使用证书登录。我想使用NTLM身份验证。如何在python中将NTLM身份验证传递给websocket链接


如果您有一个可以解决这两个问题的解决方案,请编辑或编写新答案。

您的私钥路径已更改errors@MadPhysicist,已编辑有问题的私钥路径。我也犯了同样的错误。请帮忙!我删除了你问题中的最后一行,因为这不是FaceBook现在有一个零散的空间end@MadPhysicist是的,“考虑特殊角色”。如果我不使用空格,它就不会占用
。你能告诉我这个转义字符还有其他方法吗?