How does Go realize the client "discovery" in the local area network?

for example, set a string as GroupTag. Automatically discover both sides with two devices in the local area network and verify that the GroupTag starts to exchange data if the same?

Sep.10,2021

search for "UDP broadcast", a basic network concept.


you are actually referring to a port scan function.
1. First, the client must open a port locally so that it can be connected by other clients of the LAN.
2. The client scans all clients and corresponding ports in the same network segment. If the port can connect, then send data in a specific data format to establish a connection.
3. For more information on port scanning source code, please see https://gitee.com/johng/gf/bl.

.
Menu