AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.67k stars 414 forks source link

eWeLink CoolKit servers are returning wrong port on handshake #1223

Closed n-vodenicharski closed 11 months ago

n-vodenicharski commented 1 year ago

Looks like the CoolKit severs are returning wrong port 8080 when creating the session with the dispatch API: _await self.session.get(self.wshost, headers=self.headers) Changing the port to 443 is fixing the issue: f"wss://{resp['domain']}:443/api/ws", heartbeat=90

It will be nice to have a configurable parameter to override the port.

AlexxIT commented 11 months ago

I haven't heard about this problem. Maybe temporary issue

n-vodenicharski commented 11 months ago

True, it is working now. GET to https://eu-dispa.coolkit.cc/dispatch/app, returns { "port": 8080, "domain": "eu-pconnect11.coolkit.cc", "error": 0, "reason": "ok", "IP": "52.59.155.15" } but now you can wss://52.59.155.15:8080/api/ws to it. It was not the case before.

n-vodenicharski commented 11 months ago

Maybe a temp issue.