github.com/anacrolix/torrent@v1.61.0/listen.go (about)

     1  package torrent
     2  
     3  import "strings"
     4  
     5  func LoopbackListenHost(network string) string {
     6  	if strings.IndexByte(network, '4') != -1 {
     7  		return "127.0.0.1"
     8  	} else {
     9  		return "::1"
    10  	}
    11  }