TuyaAPI / cli

🔧 A CLI for Tuya devices
MIT License
266 stars 43 forks source link

Anyproxy no longer working with current iOS Tuya App #19

Closed Apollon77 closed 5 years ago

Apollon77 commented 5 years ago

@codetheweb I got reports on my side tht the proxy is no longer working with the most uptodate Handy apps. I also can reproduce that with the most current iOS App (3.10.1) :-(

Can you reproduce that or is it still working for you?

Charles Proxy is still working ...

Apollon77 commented 5 years ago

When checking Charles then all requests are done using HTTP/2 and compressed ... compression should be supported by Anyproxy ... But all requests are shown as HTTP/1.1 there ... do'nt know if this is the problem ...

Apollon77 commented 5 years ago

Info: it seems that on Android App version 3.9 is working, app 3.10 not ... Android older version could be available at https://github.com/Apollon77/ioBroker.tuya/issues/url

Apollon77 commented 5 years ago

Is someone able to dig into the APp to check the differences? I would expect they added client certificated or other cert chain checking to the App ... but then decompiling could help to get the details /certs :)

Apollon77 commented 5 years ago

One info from one user (unverified):

The main difference beetween the packages version is the node. I downgraded the debian's 10.15.2 to 8.16.0 from nodesource and the proxy start working, even with the 3.11 Smart Life app. Before that, i got the network error in the app.

codetheweb commented 5 years ago

Just tried with v8.16.0 and no success, although I do have the iOS 13 beta which may be part of the issue.

Kleinstein-github commented 5 years ago

tipp: make the iobroker hom plugin like the hombridge google home assistant plugin

Apollon77 commented 5 years ago

What do you mean?

Kleinstein-github commented 5 years ago

i mean like this: https://github.com/basdelfos/homebridge-tuya-web with the google api

Apollon77 commented 5 years ago

This is rather limited compared to the solution we have. And in fact the Proxy solution is still somehow working. Please use iobroker forum to get support.

codetheweb commented 5 years ago

Meant to update this but forgot.

I took another look a few days ago and since AnyProxy isn't working with any HTTPS sites, my guess is that the issue is on their side.

I contacted Tuya and asked them if it was possible to add the localKey to responses in the Home Assistant API, but they refused.

Apollon77 commented 5 years ago

Maybe then we should open an issues anyproxy side??

codetheweb commented 5 years ago

There's already 176 open issues, many of them similar to the problem we're facing. I think we need to find something else to use.

AnyProxy does work for HTTPS sites when requests come from my laptop, it just doesn't seem to work with iOS for some reason.

Apollon77 commented 5 years ago

:-( I searched. very long time till I found Anyproxy to use it here :-(

codetheweb commented 5 years ago

https://github.com/codetheweb/tuyapi/issues/215#issuecomment-527269461

Apollon77 commented 5 years ago

That sounds awesome! I will adjust my code, test by myself and and also let users test it. If that works we are back into the game ;-)

Apollon77 commented 5 years ago

Adaopted your code and IT WORKS!! Great man. Thank you vry much!

codetheweb commented 5 years ago

No problem, glad to hear it.

Apollon77 commented 4 years ago

@codetheweb I had some users with ECONNRESET and other ssl errors (https://github.com/Apollon77/ioBroker.tuya/issues/67) ... I did some changes inspired from e.g. https://github.com/joeferner/node-http-mitm-proxy/issues/165 and such ... see https://github.com/Apollon77/ioBroker.tuya/commit/83c4a50a939139831b8c2a8392f75cf8f07afa83 (main,js) ... I report back on results

Apollon77 commented 4 years ago

@codetheweb also the latest changes did not made it better ... https://forum.iobroker.net/topic/16103/aufruf-neuer-adapter-iobroker-tuya-wlan-devices-tuya-smart-life-und-andere/516 :-(

Still problems

codetheweb commented 4 years ago

Hmm, unfortunately there's a lot variables that can result in weird errors like you're seeing. A few off the top of my head:

All that to say that it's really hard to reproduce most issues users see in this area unless they give great detail about their environment.

If you/others are able to consistently reproduce any problem, please open an issue with as much detail as possible. Otherwise, I'm sorry but I can't really help.

Apollon77 commented 4 years ago

@codetheweb I mainly posted it here as status update that you know stuff if tuya-cli users are coming with them ...

codetheweb commented 4 years ago

👍

Apollon77 commented 4 years ago

I also did some adjustments on my code like reading full message and not only one chunk. As soon as it is proven I Update here too

Apollon77 commented 4 years ago

@codetheweb The lastest changes i did in my stuff to get it successfully working qith all problems cases from users is referenced in https://github.com/codetheweb/tuyapi/issues/250#issuecomment-531639344 ... If you are faster then me to get the changes from there I can also prepare a PR