chat.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:peristop 作者: marin-m 项目源码 文件源码
def connect(self):
        self.ended = True
        self.hadCtrl = False
        self.reconnectTime = time()

        if self.timeout:
            self.timeout.cancel()

        ws = WebSocketApp(self.endpoint.replace('https:','wss:') + '/chatapi/v1/chatnow',
                          on_open = self.authentify,
                          on_message = self.parse,
                          on_error = self.error,
                          on_close = self.close, header={'User-Agent': 'ChatMan/1 (Android) '})

        self.timeout = Timer(80, self.ratamioche)
        self.timeout.daemon = True
        self.timeout.start()

        self.ws = ws
        ws.run_forever(sslopt=sslopt_ca_certs, ping_timeout=90)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号