python连接websocket wss

python学习网 2020-07-08 14:42:02
def websocket_wss():
    try:
        wss = create_connection(wss_url, timeout=10)
        if wss.status == 101:
            wss.send(data)
            print(ws.recv())
    except BaseException as msg:
        print('失败: ' + str(msg))

 

阅读(2402) 评论(0)