From 45a331f920c9d5dc530d8cbe521684d4eae64c83 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 3 May 2019 13:26:40 -0700 Subject: [PATCH] add comments --- src/croc/croc.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/croc/croc.go b/src/croc/croc.go index f37ff7be..05801589 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -305,12 +305,16 @@ func (c *Client) Send(options TransferOptions) (err error) { for { data, _ := conn.Receive() if bytes.Equal(data, []byte("ips?")) { + // recipient wants to try to connect to local ips var ips []string + // only get local ips if the local is enabled if !c.Options.DisableLocal { + // get list of local ips ips, err = utils.GetLocalIPs() if err != nil { log.Debugf("error getting local ips: %s", err.Error()) } + // prepend the port that is being listened to ips = append([]string{c.Options.RelayPorts[0]}, ips...) } bips, _ := json.Marshal(ips)