Interfacing out components for unit testing

This commit is contained in:
Tim Beatham
2023-10-26 16:53:12 +01:00
parent f1cfd52a91
commit 4c6bbcffcd
28 changed files with 714 additions and 494 deletions

View File

@ -5,14 +5,13 @@ import (
"net"
)
// GetOutboundIP: gets the oubound IP of this packet
func GetOutboundIP() net.IP {
conn, err := net.Dial("udp", "8.8.8.8:80")
if err != nil {
log.Fatal(err)
}
defer conn.Close()
localAddr := conn.LocalAddr().(*net.UDPAddr)
return localAddr.IP
}