mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 21:30:16 +02:00
customize multicast address
This commit is contained in:
parent
d3fdb4257d
commit
e58fc14218
1 changed files with 8 additions and 5 deletions
|
@ -54,6 +54,7 @@ func (c *Croc) Send(fname, codephrase string) (err error) {
|
|||
TimeLimit: 600 * time.Second,
|
||||
Delay: 50 * time.Millisecond,
|
||||
Payload: []byte(c.RelayWebsocketPort + "- " + strings.Join(c.RelayTCPPorts, ",")),
|
||||
MulticastAddress: "239.255.255.252",
|
||||
})
|
||||
log.Debug(discovered, err)
|
||||
}()
|
||||
|
@ -76,11 +77,12 @@ func (c *Croc) Send(fname, codephrase string) (err error) {
|
|||
|
||||
// Receive the file
|
||||
func (c *Croc) Receive(codephrase string) (err error) {
|
||||
defer log.Flush()
|
||||
log.Debug("receiving")
|
||||
|
||||
// use local relay first
|
||||
if !c.NoLocal {
|
||||
log.Debug("trying discovering")
|
||||
log.Debug("trying to discover")
|
||||
// try to discovery codephrase and server through peer network
|
||||
discovered, errDiscover := peerdiscovery.Discover(peerdiscovery.Settings{
|
||||
Limit: 1,
|
||||
|
@ -89,6 +91,7 @@ func (c *Croc) Receive(codephrase string) (err error) {
|
|||
Payload: []byte("checking"),
|
||||
AllowSelf: true,
|
||||
DisableBroadcast: true,
|
||||
MulticastAddress: "239.255.255.252",
|
||||
})
|
||||
log.Debug("finished")
|
||||
log.Debug(discovered)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue