Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Don't let the server ID be 127.0.0.1
- Loading branch information
Showing
with
9 additions
and
5 deletions.
-
+9
−5
util.go
|
@@ -42,12 +42,16 @@ func getInterfaces() []string { |
|
|
|
|
|
// default to the first interfaces |
|
|
// todo: skip 127.0.0.1 and ::1 ? |
|
|
if len(serverInfo.ID) == 0 { |
|
|
serverInfo.ID = ip |
|
|
} |
|
|
if len(serverInfo.IP) == 0 { |
|
|
serverInfo.IP = ip |
|
|
|
|
|
if ip != "127.0.0.1" { |
|
|
if len(serverInfo.ID) == 0 { |
|
|
serverInfo.ID = ip |
|
|
} |
|
|
if len(serverInfo.IP) == 0 { |
|
|
serverInfo.IP = ip |
|
|
} |
|
|
} |
|
|
|
|
|
inter = append(inter, host) |
|
|
|
|
|
} |
|
|