schollz / peerdiscovery

Pure-Go library for cross-platform local peer discovery using UDP multicast :woman: :repeat: :woman:
MIT License
644 stars 56 forks source link

Does this discover peers that are not also running this software? #3

Closed nathanpaulyoung closed 4 years ago

nathanpaulyoung commented 6 years ago

Does this discover peers that are not also running this software, or do all peers need to be running this in some sort of "listening" mode?

schollz commented 6 years ago

There is a specific port and address specified, so it will discover anyone broadcasting on with that address and port

nathanpaulyoung commented 6 years ago

I skimmed the example and didn't see where those are specified. Are you saying that the address and port are configurable, or that there is a hardcoded port and/or address range that it checks? Additionally, does it require a particular response payload, or is it basically just looking for an ACK?

schollz commented 6 years ago

They are specified in the settings: https://github.com/schollz/peerdiscovery/blob/master/peerdiscovery.go#L25

In the example I used the defaults.

The payload is optional

zxbit2011 commented 6 years ago

1、只是限于局域网适用吗? 2、需要服务器来中转广播?

nathanpaulyoung commented 6 years ago

Google translating the above questions:

  1. Is it limited to LAN?
  2. Does it need a server to relay the broadcast?
schollz commented 6 years ago

@zxbit2011 @nathanpaulyoung

  1. Yes.
  2. No - each instance does "broadcasting" and "listening" so in that sense, each instance is a server and a client.