#48: Add local address information

This commit is contained in:
mhhcbon
2022-03-22 09:50:46 +00:00
committed by Huin
parent ca81a64b42
commit e739c716b4
3 changed files with 33 additions and 1 deletions
+7
View File
@@ -143,9 +143,16 @@ func (httpu *HTTPUClient) Do(
continue
}
// Set the related local address used to discover the device.
if a, ok := httpu.conn.LocalAddr().(*net.UDPAddr); ok {
response.Header.Add(LocalAddressHeader, a.IP.String())
}
responses = append(responses, response)
}
// Timeout reached - return discovered responses.
return responses, nil
}
const LocalAddressHeader = "goupnp-local-address"