'WeChat WebSocket communication works only on an emulator

I'm trying to do send some messages (MQTT) using WeChat and WebSockets. I'm following steps described on https://segmentfault.com/a/1190000040627614/en . It's working perfectly in an emulator but not on a real device. It's not able to connect. Are there any settings in WeChat blocking such connections?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source