# Local Area Network Communication
The base library 2.4.0 provides a set of mDNS APIs such as wx.startLocalServiceDiscovery that can be used to obtain the IP of devices in the local network that provide mDNS services.
wx.request / wx.connectSocket / wx.uploadFile / wx.downloadFile ${IP}: ${PORT} / ${PATH}If and only if the IP is on the same network segment as the mobile IP and is not the same as the local IP.
In this case, security domain validation is not performed, https / wss is not required, and http / ws can be used.
wx.request({
url: 'http://10.9.176.40:828'
// 省略其他参数
})
wx.connectSocket({
url: 'ws://10.9.176.42:828'
// 省略其他参数
})
Beginning with the base library 2.7.0, the wx.createUDPSocket interface is provided for UDP communication.The communication rules are the same as above, only non-local IPs in the same local network are allowed.
# mDNS
Currently Weixin Mini Program only supports the mDNS protocol to obtain the IP of other devices in the local network.The mDNS API implementation on iOS is based on Bonjour , and on Android it is based on Android system interface .
Due to the change in operating system related capabilities, iOS WeChat Guest version 7.0.18 and above cannot use mDNS related interfaces, Android version is not affected
serviceType
Initiate mDNS service search wx.startLocalServiceDiscovery Has a serviceType argument that specifies the type of service to look for.
The format and specification of serviceType, iOS Bonjour Overview Mentioned in Bonjur Names for Existing Service Types .

The Android documentation also mentions this.
