The official description of WeChat applet websocket is like this
The URL here needs to use a domain name, such as wss://nblftech.xxx.com
But when we actually develop the websocket server program, we need to specify the port number. Suppose we define the port number 8181, then the URL for normal websocket to establish a connection should be
wss://ip:8181
Found in the mini program wx.connectSocket(OBJECT), if in debugging mode, The port number can be specified in the URL.
In non-debugging mode, the port cannot be specified in the URL. I did not find the default port number specified by the mini program in the official documentation (if anyone knows, please let me know)
Later, I checked the third-party information http://blog.csdn.net/supermig/article/details/ 49358171, found that using port 443, you can connect to websocket in non-debugging mode.
PS: Let’s assume that the default port number of the mini program websocket is 443.
For more articles related to WeChat mini program websocket port configuration, please pay attention to the PHP Chinese website!