mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-10 07:45:36 +02:00
Compare commits
3 Commits
93a9f2e5c9
...
0475dd5766
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0475dd5766 | ||
|
|
a318876eb3 | ||
|
|
f20f01e6d6 |
@@ -53,7 +53,7 @@ func InitWebRTCAPI() error {
|
||||
|
||||
nat11IP := GetFlags().NAT11IP
|
||||
if len(nat11IP) > 0 {
|
||||
settingEngine.SetNAT1To1IPs([]string{nat11IP}, webrtc.ICECandidateTypeSrflx)
|
||||
settingEngine.SetNAT1To1IPs([]string{nat11IP}, webrtc.ICECandidateTypeHost)
|
||||
slog.Info("Using NAT 1:1 IP for WebRTC", "nat11_ip", nat11IP)
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ func getLocalIP() string {
|
||||
return ""
|
||||
}
|
||||
for _, address := range addrs {
|
||||
if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() {
|
||||
if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() && !ipnet.IP.IsPrivate() && !ipnet.IP.IsUnspecified() {
|
||||
if ipnet.IP.To4() != nil || ipnet.IP != nil {
|
||||
return ipnet.IP.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user