sigalor / whatsapp-web-reveng

Reverse engineering WhatsApp Web.
MIT License
6.1k stars 802 forks source link

Whatsapp closed #267

Open saxtorinc opened 4 years ago

saxtorinc commented 4 years ago

[1] Message after login: 1585527026,["Cmd",{"type":"update"}] [1] Traceback (most recent call last): [1] File "/app/backend/whatsapp.py", line 149, in onMessage [1] self.loginInfo["serverRef"] = json.loads(messageContent)["ref"]; [1] TypeError: list indices must be integers, not str [1] [1] send: '\x88\x82\xb6\xb9a\xe5\xb5Q' [1] sending {"type": "resource_gone", "resource": "whatsapp", "resource_instance_id": "10a70c37576a412999bd9c5ca2325467", "from": "backend"} [1] WhatsApp backend Websocket closed. [0] got message { [0] type: 'resource_gone', [0] resource: 'whatsapp', [0] resource_instance_id: '10a70c37576a412999bd9c5ca2325467', [0] from: 'backend' [0] }

gzsendiEhc commented 4 years ago

I met the same problem, who can solve it?

gzsendiEhc commented 4 years ago

I found out that this problem might require proxy.

self.activeWs = websocket.WebSocketApp("wss://web.whatsapp.com/ws", on_message = lambda ws, message: self.onMessage(ws, message), on_error = lambda ws, error: self.onError(ws, error), on_open = lambda ws: self.onOpen(ws), on_close = lambda ws: self.onClose(ws), header = { "Origin: https://web.whatsapp.com" });

websocket.run_forever(http_proxy_host="127.0.0.1", http_proxy_port=1087);

    **self.activeWs.run_forever(http_proxy_host="127.0.0.1", http_proxy_port=1087);**
    self.websocketThread = Thread(target = self.activeWs.run_forever);
    self.websocketThread.daemon = True;
    self.websocketThread.start();