python连接websocket wss

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))

 

posted @ 2020-07-07 20:03  Echo丶Mikasa  阅读(2345)  评论(0)    收藏  举报