2018-04-12 09:41:07 +08:00
|
|
|
package torrent
|
|
|
|
|
2018-04-12 13:21:31 +08:00
|
|
|
import "strings"
|
|
|
|
|
|
|
|
func LoopbackListenHost(network string) string {
|
2021-09-14 19:54:37 +08:00
|
|
|
if strings.IndexByte(network, '4') != -1 {
|
2018-04-12 13:21:31 +08:00
|
|
|
return "127.0.0.1"
|
|
|
|
} else {
|
|
|
|
return "::1"
|
|
|
|
}
|
|
|
|
}
|